I'm using groovy to try and automatically set an issue's FixVersion in a post function to one of 3 values, depending on where the issue is in our release pipeline.
For example, let's say I'm transitioning issue FOO-150, and I want to set its FixVersion to 1003 in the post function.
A tried to query the FixVersion of an existing issue (say BAR-42) whose FixVersion I had preset to 1003, but couldn't get it to work. Another way I thought of to try was to create the 3 FixVersions for the BAR project, but I don't see how to get the middle value - only the first() and last(). (Obviously, I'm a newbie at all of this ; )
Do either of those sound reasonable? or is there a better way?
I have JIRA Server v7.7.1 and ScriptRunner v5.4.12
Thanks!