I just started using Releases and versions in my JSW project. When I transition an issue to DONE I would like the Fix Versions to be set to the latest unreleased version. How would I do this?
Hi @Paul Dokken
You may do that with an Automation for Jira rule. For example:
You could remove the condition if you want to replace any existing value.
To learn more about automation rules, please look at these sources and examples:
Kind regards,
Bill
Perfect! This is exactly what I was looking for. Thanks so much for sharing your knowledge.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Follow up question,
How can I set the fixVersion not to the next Unreleased version, but to the one right after?
Also, is it possible to read the {{pullRequest.destinationBranch.name}} variable, parse it and dynamicly set the fixVersion?
Example: If the branch is develop, I want to set the version to 1.1.0
If the branch is release-1.0.0, I want to set the version to 1.0.0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Salim Ubeydullah -- Welcome to the Atlassian Community!
The short answer to your first question is: probably not. Smart value lists do not have the ability to be sorted, and so you cannot find the "one before the next one".
For your second question, the answer is "yes". A version can be set from the drop-down list or from a smart value expression, and so you would create an expression to get that version number from the branch name to use it.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, yes I tried the second option and it works.
My third solution is to have a label set on the PR, that matches a release version name in JIRA, grab that and set it as the release version. Is that doable?
is there a smart variable like {{pullRequest.labels}} ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Based on the documentation, those labels may not be available: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-development/#--Pull-request--
However...everything possible is not listed in the documentation. So I recommend making a test rule which is triggered to access a PR, and then write the contents to the audit log (or email them to yourself) as JSON to see what is available for access.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, Since Labels is probably an array, what would be a good guess to try to set the fixVersion to all the label, then JIRA will only pick the ones that matches an existing Release name?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you confirm the labels are available?
And if you are trying to set multiple versions based upon data, such as from the fields, you would need extract the labels, expand the list, and then format them for advanced edit with JSON, as described here: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Fix-Versions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the audit log. The 20 that I mentioned should meet the condition that all are transitioned to done and Fix Versions is empty. The reason I have the rule global is I want it to run on both my software projects which each have their own Fix Versions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I thought it was working but has only worked on 2 issues out of about 20 that have already been done. I have made sure the scope is set for the project. Any ideas?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Paul.
When you note it only worked on 2 issues out of 20, what are you observing happening?
Can you post images of the audit log details showing executions where it worked and did not work as expected?
Next, I notice you have set this up as a global scope rule.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
Here is the audit log. The 20 issues that I mentioned should have met the condition of transitioning to done and Fix Versions is empty to only 2 ran.
The reason I made the rule global is that there are 2 software projects and each of them have their own Fix versions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that info, Paul.
According to the audit log, the rule seems to be triggering for only one project: FSO. Were there other issues for that same project which did not trigger the rule?
And, are these Company-managed or Team-managed projects?
I ask because the "Done" status for company-managed project is probably a shared/reused status in your Jira site. For team-managed, each project has its own set of status values. So perhaps the rule is not picking up one of them for the project.
If one (or both) projects are team-managed, you can check this by copying the rule to one of the projects, disabling the global rule, and see if the project-specific rule works as expected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FSO is a team managed project. The scope is now just for software projects. I am wondering if I need to have the Check to allow other rules... checkbox checked since I have an automation that moves the status to to done.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah...yes, you do. The "Allow rule trigger" option does that. The default is disabled to prevent a runaway rule/looping condition, and in your case you want one rule to trigger another. Sorry I missed that!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.