I have 2 custom (global) fields "Impact group" and "High level estimate" which are dropdowns. Each option in the dropdown I want to associate with a number. Then I want to add those 2 numbers and show the result in another custom field "Calculated priority" (number).
My fields:
"Impact group" (dropdown):
Internal stakeholders - should be worth 5 points
Compliance and legal - should be worth 4 points
"High level estimate" (dropdown):
Low: should be worth 1 point
Medium: should be worth 2 points
Now, for example, if I select:
"Internal stakeholders" AND "Low" -> my calculated priority should show 6
"Internal stakeholders" AND "Medium" -> the result should be 7
"Compliance and legal" AND "Low" -> 5
Etc.
I don't want to use ScriptRunner. I am using Automation and creating a Rule for "Value Changed". You can see where I am entering the formula:
My formula is not working. Any idea why?
{{#=}}
0 +
{{#if(equals(issue.fields.Impact group.value, "Internal stakeholders"))}}5{{/}}
+ {{#if(equals(issue.fields.Impact group.value, "Compliance and legal"))}}4{{/}}
+ {{#if(equals(issue.fields.High level estimate.value, "Low"))}}1{{/}}
+ {{#if(equals(issue.fields.High level estimate.value, "Medium"))}}2{{/}}
{{/}}
Hi @Tanya
Will the values grow much going into the future? if not I think it might be easier to create and maintain this functionality using the IF or ELSE: Add condition options
This is how we create our incident priority matrix calculation
I am getting these errors in audit log - whether or not I try ids or field names. What doe sit mean? Also as you can see in the attached video, "Computed priority" stops working after I make a few selections:
https://www.dropbox.com/scl/fi/8yk4azzeomyqv37vl1z5q/stuck.mov?rlkey=wbvel5c1bnb6pj55ejs2e0i2a&dl=0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tanya ,
as a member of the app development team, I recommend exploring our Awesome Custom Field app, which includes the Advanced Formula field. This feature allows you to perform the necessary calculations effortlessly with Jira expressions, without the need for automation.
In case you have feedback, please get in touch!
Cheers,
paul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@TanyaShould be
issue.High level estimate.value OR High level estimate.value
However in a formular It's better to use the customfield id instead of the name should you change its name later.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried it and I always get this - it changed numbers as needed, and then it gets stuck and doesn't do anything. The delay also is very long. Why?
See in this video I set fields to "Compliance and Legal" AND "High" = 7. Ok. Then I change to "Low" - nothing changes.
https://www.dropbox.com/scl/fi/8yk4azzeomyqv37vl1z5q/stuck.mov?rlkey=wbvel5c1bnb6pj55ejs2e0i2a&dl=0
Again my formula was this below, and I get the same result with ids:
{{#=}}
0
+ {{#if(equals(issue.Impact group.value, "Internal stakeholders"))}}5{{/}}
+ {{#if(equals(issue.Impact group.value, "Compliance and legal"))}}4{{/}}
+ {{#if(equals(issue.fields.Impact group.value, “Customers”))}}3{{/}}
+ {{#if(equals(issue.fields.Impact group.value, "Partners and vendors"))}}2{{/}}
+ {{#if(equals(issue.fields.Impact group.value, "Development team"))}}1{{/}}
+ {{#if(equals(issue.High level estimate.value, "Low"))}}1{{/}}
+ {{#if(equals(issue.High level estimate.value, "Medium"))}}2{{/}}
+ {{#if(equals(issue.High level estimate.value, "High"))}}3{{/}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@TanyaBased on the error from the log, problem seems to be "+" being outside the condition.
Should be 0+4+1 , not 0 + + 4 + + + + 1 + +
Put it inside.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Regarding your formula possibly changing to using the custom field ID's might
workissue.fields.customfield_XXXXX
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.