Add fix version when closing an issue

Ruban Jayathas June 16, 2016

How can I add a fix version when closing an issue based on a condition. I am using the fast track transition automation script.

1 answer

1 accepted

1 vote
Answer accepted
Mahesh S
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.
June 16, 2016

Add a normal post function to set the Fix version value in the workflow. When the condition is true for the fast track transition, the post function in the workflow also gets triggered while moving to new status.

Mahesh S
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.
June 16, 2016

In my latest script runner, I have this Additional issue action option as well. I can set the new fix version value here directly.

Add an if condition and put your setFixVersions method inside it directly or in the workflow postfunction.

Untitled.png

 

Ruban Jayathas June 16, 2016

I tried the following but the static type check tells me it is wrong. Not sure what the deal is.

issueInputParameters.setResolutionId('1')
issueInputParameters.setFixVersionIds(16.06)
Mahesh S
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.
June 16, 2016

You are almost done! 

You were passing the Fix version value here. Instead, pass the version Id. Go to your Project -> Project Administration -> Version -> Find your version 16.06.

Untitled.jpg

Then click options, Ctrl+Click on Release & Build. It opens in a new page and find the version Id in the URL in address bar like '......../versions/10000 ?selectedTab.........'

OR

Right Click on version (here test1) -> Inspect Element -> find the version Id as shown below.

Untitled.png

Ruban Jayathas June 16, 2016

Thank you it works great now

How would I modify this to automatically take the last version that I have added ? Right now the version I have added is valid until June 30th but from July 1 there will be a new version. 

Can I have some conditonal logic based on the created date to use a particular fixversion ?

Mahesh S
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.
June 17, 2016

Yes your logic is right, if based on the created date of version. But, finding the version date is again challenging. I would suggest to get the latest version based on the version Id (get the list, convert to long and choose the highest version)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events