Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need a Automation rule to populate the "External Fix Version" based on the "Fix Version"

Asmath Basha
Contributor
January 16, 2025

Need a Automation rule to populate the "External Fix Version" based on the "Fix Version".
If we give the version as "AKA_100" in the "Fix Version" then in the "External Fix Version " it should populate the version as "AKA_100_DONE". 
Like this we have around 30 fix versions and 30 external fix versions. Based on the Fix version the external fix version should change in the ticket.

Can anyone suggest the idea on this.

2 answers

0 votes
Bill Sheboy
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.
January 22, 2025

Hi @Asmath Basha 

What is the type of your "External Fix Version" field?  For example, is it a Single-Select Version Picker?

If so, the version must be set using the id and not the name of the version.

And, do you only expect one-and-only-one value in the Fix Versions field, as that is a list of values?

Kind regards,
Bill

Asmath Basha
Contributor
January 22, 2025

Hi @Bill Sheboy ,

=> Type of "External Fix Version" field is Multiple-Select Version.
=> In "Fix version" and "External Fix Version" there are a list of values present. Based on the "Fix version" value the appropriate value from "External Fix Version" should populate using Automation.
=> Can you give the Automation rule to set using ID instead of name of the version.

Regards,

Asmath

Bill Sheboy
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.
January 23, 2025

Thank you for that information, as it indicates one-to-many values in both fields.

Should the "External Fix Version" always contain all of the values in the "Fix Versions" field?

If the fields should have the same values, you could simply use the COPY option for the field:

  • in the issue edit action, select your "External Fix Version" field from the dropdown list
  • at the right of the field, under the ... select the COPY option
  • select the field, and change the "Field to copy from" to "Fix Versions"
  • decide if you want to replace the values or "Add to existing values" for the checkbox selection

 

If the fields could have different lists of values, the rule will need to implement any decision making you need, and then use list iteration and build a dynamic JSON expression to set the field under "More options" for the issue edit action:

 

Asmath Basha
Contributor
January 27, 2025

Hi @Bill Sheboy , thanks for your valuable information.

  • Here we are using different list of values. 
  • Can you show me the example of Automation to setup, so that it should be clear to configure in the instance.

 

Bill Sheboy
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.
January 27, 2025

I recommend first trying to create the rule yourself, and if you run into problems to ask the community for help.

You will better understand the criteria for the handling of the different version values, and so we would need to see that logic to compare to your rule.

Additionally, I note you seem to be posting several questions and asking the community to just write rules for you.  Perhaps meet with your Jira Site Admin to ask for their help to learn more about writing rules.

Asmath Basha
Contributor
January 28, 2025


Hi @Bill Sheboy , thanks for your reply. 

  • I have tried the Automation rules in my own instance and I have added the screenshot of the Automation rule as well. I am also a Jira admin and working on the requests.
  • Also in this Atlassian community I was not only posting the questions to get the help. I had my old ID also in which you can check my history of Answers submitted and Questions asked. Link of my old ID : https://community.atlassian.com/t5/user/viewprofilepage/user-id/5035082 
  • Unfortunately I can't access to my old ID so I have created a new one and collaborating with the community. I have got some queries regarding the Automation, so I asked a questions in the community to get the help.
  • I have learned many things in Jira with the answers which was submitted by you and other community leaders. Anyway thanks for your answers for my queries.

 

External_Fixversions_rule.png

 

Fixversions_rule.png

Like Noah Leu likes this
Bill Sheboy
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.
January 28, 2025

The rule you show is trying to copy the values from the Fix Versions field to the External Fix Versions field, adding _DONE to the version names.

 

Have you confirmed those additional "_DONE" versions already exist?

 

How many versions are in the Fix Versions field: 1, many, or do not know?

If the number of versions is anything other than 1, the rule will need to use dynamic JSON, as I described earlier.

First, you may remove the created variable for this scenario, unless you want to write it to the audit log for testing.

Next, the Edit Issues Field should remove the External Fix Versions field from the dropdown list, and instead use dynamic JSON:

{
"fields" : {
[
{{#issue.fixVersions}}
{ "name": {{name.concat("_DONE").asJsonString}} } {{^last}},{{/}}
{{/}}
]
}
}

How this works:

  • Iterate over the values in the Fix Versions field
  • For each one found, add the "name" with "_DONE" concatenated on the end
  • Because the concat() function used quotation marks, we could not also wrap the entire expression in them.  Instead, add the asJsonString to add the quotes.
  • Finally, use the conditional {{^last}}, {{/}} to add commas between the names, but not have a trailing one.

 

When you implement this rule, I recommend testing it carefully, and then pausing to teach it to another team member.  This will help you confirm your understanding of the rule by answering their questions about it, and to share the knowledge on the team.

 

0 votes
Noah Leu
Community Champion
January 16, 2025

Hey @Asmath Basha ,

assuming the "External Fix Version" is a version picker and the "External Fix Version" versions are the same as  "Fix Version" extended with a "_DONE". Then you could set up the automation like this:

  • When: Values Changes for Fix versions
  • Then: Create variable
    • name: externalFixVersion
    • smart value: {{#issue.fixVersions}}{{name}}_DONE{{/issue.fixVersions}}
  • And: Edit issue fields
    • field: External Fix Version
    • value: {{externalFixVersion}}


Of course new versions need to be created to both version pickers, otherwise the rule may run into errors.

I hope this helps you to set it up. Let me know if you have questions.

Best regards
Noah

 

Asmath Basha
Contributor
January 16, 2025

Hi @Noah Leu , I have followed the steps which was mentioned by you. Still It doesn't populate the values in "External Fix Version" based on the "Fix Version". Can you help me on this.

Noah Leu
Community Champion
January 16, 2025

Hey @Asmath Basha ,

sure I can help you on this. 😉

I made it work on my side. Can you share some screenshots from the automation you have build? You can also check the audit log (top right when editing the automation rule) of the automation rule to find the mistake. Here are some things you can troubleshoot in advance:

  • Check if you listen to the correct field (trigger)
  • Check if you have used the same variable names in the two actions
  • Check if you have missed any brackets
  • Check if you edit the correct customfield
  • Check if the automation scope is correct (if more then 2 projects are involved)
  • Check if the actor has the permission

Best regards

Noah 

Asmath Basha
Contributor
January 21, 2025

External_Fixversions_rule.pngFixversions_rule.pngHi @Noah Leu ,
Kindly check the automation rules which I have setup and suggest the changes to work on this.

Noah Leu
Community Champion
January 22, 2025

Hey @Asmath Basha ,

the setup looks good to me. Could you run a test by adding a log action before the edit action, then change a fix version to trigger the rule and then check the audit log for troubleshooting. Like this:

Automation Troubleshoot.png

If you notice any strange behaviour or details let me know.

Best regards
Noah

Asmath Basha
Contributor
January 22, 2025

Hi @Noah Leu , I have added log action and attached the screenshot. In the Audit log everthing looks fine but you can see in the ticket the value was not added.
Can you look into this.
Notcopied_values.pngAudit_log.png

Noah Leu
Community Champion
January 23, 2025

Hey @Asmath Basha , 

could you confirm that both versions already exist? The automation can not generate new versions. Bother version have to be already existing. 

Best regards
Noah

Asmath Basha
Contributor
January 24, 2025

Hi @Noah Leu ,

Yes, both the versions are already exist. 

Noah Leu
Community Champion
January 28, 2025

Hey @Asmath Basha ,

as I can't reproduce your error and can't double check this you may want to double check with your Jira admin. Somehow the value does not get correctly copied into the External Fix Version Field.

Best regards

Noah

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events