Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JMWE validator "Issue is in Active Sprint" doesn't work

Barys Harbacheuski November 19, 2018

I try to set a validator on transition: allow transition "Start Progress" only if the issue is in Active Sprint using JMWE plugin. I use Groovy script "issue.get("Sprint")*.active". When I test this script, it returns true on the issue in Active Sprint and false for issues in Closed and Future Sprint. But after publishing workflow, the validator doesn't work: issues in Closed and Future Sprints are allowed to make transition.Screenshot_1.pngScreenshot_2.png

2 answers

1 accepted

0 votes
Answer accepted
David Fischer
Community Champion
May 6, 2019

issue.get("Sprint") actually returns a collection of Sprints: the active Sprint, plus all the closed Sprints the issue potentially belonged to before. To get the active sprint, use:

issue.get("Sprint")?.find{it.active}

To create a condition or validator from that, and to be safe, use:

 !!issue.get("Sprint")?.find{it.active}
Barys Harbacheuski February 21, 2020

@David Fischer just got back to this question :) Thanks for solution!

0 votes
Ash
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2019

Hi @Barys Harbacheuski  did you figure this out?

I;m looking for same condition on the post function.

Barys Harbacheuski February 21, 2020

Hi @Ash

Solution below works well, if it's still relevant for you.

Like Ashish_Kanaparthi likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events