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

This widget could not be displayed.

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
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

174 views 1 3
Join discussion

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