How would be the script condition for: "issue is not in status, e.g closed"?

Tatiana Jancusova March 10, 2014

I realy like the possibility to add global transitions to workflow with many statuses. But if once was ticket closet I want to have only one possibility - to reopen it.

There is a condition: Checks the issue has been in a status previously

Do somebody know how would be the script condition for: "issue is not in status e.g closed"?

Or do you have another idea?

1 answer

1 accepted

0 votes
Answer accepted
Henning Tietgens
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.
March 11, 2014

If you use the JIRA Suite Utilities you could use the Value Field condition and check that status != Closed.

If you use Script Runner, you can write issue.statusObject.name != "Closed"

Tatiana Jancusova March 11, 2014

of course! :D Thank you!

Roy Chapman March 27, 2019

Now I'm confused.  I have an All -> Cancelled transition called "Request Cancelled".  If I use

issue.getStatus() != "Done"

and the status is in Done the condition works.  But if I use

issue.getStatus() != "Cancelled"

and the status is in Cancelled it doesn't and the transition is available.

Any pointers?

Henning Tietgens
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.
March 27, 2019

With getStatus() you get a Status object, which is not exactly what you want. You want the name of the Status object, so you should write

issue.getStatus().getName() != "Done"

or even simpler

issue.status.name != "Done"
Like # people like this
Roy Chapman March 28, 2019

Henning,

Thanks.  Very confusing, even with these changes the condition was failing.  I removed the conditions, published the workflow and then re-added and it worked.  No rhyme nor reason, but the equivalent of "turn it off and on" fixed the problem.

Thanks again

Roy

Suggest an answer

Log in or Sign up to answer