Transition Issue Groovy Script

I was wanting to use the post function - Transition Issue - and have it based on if the groovy script were true.  

However, I'm not sure how to write the groovy script and I don't have the coding resources here to help and am hoping this forum could. 

I need a script that would evaluate if all four custom date fields are not null - that way, if they were all not null, it would return as true and it would transition; but, if at least one were null, it wouldn't transition. 

I located the field IDs that I'm interested by getting the ID from the URL when editing the custom field - I'm assuming that is ok.   

The IDs associated with the four fields are 14911, 14913, 14910, 14912

Could anyone be able to assist in providing a groovy script that could be used in this case for the transition issue post function.

1 answer

What you really need is a transition validator.

For this purpose i recommend to use JIRA Suite Utilities plugin. Its free and it really is helpfull.

Just do a Field Required validator as described here for all 4 firelds on transition and you will be fine.

Hi Andrey, I appreciate the suggestion. However, I cannot make them required because, in this use case, they are not required. But, I only want to transition IF those four fields are not null. If they are not, it won't transition. Basically, there are four approvers for a given state and they each have their own approval button that only they can see when it is in their queue. At any time, either can move it back to a prior state; but, it cannot move on to the next state until all four have approved. I've gotten around it by creating two different transitions: one that shows if the other three fields (other than the user's) are not completed and one that shows if all other three fields are completed. So, it works. But, I was hoping to keep the workflow simpler, if possible.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,711 views 17 21
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you