Add fix version when closing an issue

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

This widget could not be displayed.
Mahesh S Community Champion Jun 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 Community Champion Jun 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

 

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 Community Champion Jun 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

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 Community Champion Jun 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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Jul 25, 2018 in Marketplace Apps

Jira Cloud and Bitbucket Cloud Integration with Microsoft Teams

One of the newest products in the Microsoft family - Microsoft Teams,  is a chat-based hub for teamwork that integrates all the people, content, and tools your team needs to be more engaged and ...

733 views 0 3
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