calculate multiplication of 2 lists of customfields to Numeric customfield using Automation

thumuluru_shreya
Contributor
January 3, 2025

I have 2 Customfields as Severity and Occurrence. These 2 customfields are dropdown fields. It Contains

Severity contains the dropdown values as(Negligible, Minor and Major). 

Occurrence contains the dropdown values as (Critical, Probable and Improbable)

Score is the numeric customfield to store the multiplication of both severity and occurrence

Ex:

Scenario 1:

If user selects

severity as Negligible (Internally it assumes as 1)

Occurrence as Probable (Internally it assumes as 2)

So in score the result will calculate as 1*2=2

Scenario 2:

If user selects

Severity as Major( Internally it assumes as 3)

Occurrence as Critical(Internally it assumes as 1)

So in score the result will calculate as 3*1= 3

Expected output:

We took 2 customfields as dropdown list and we are expecting the output as multiplication of both customfields as Numeric. And this numeric maltiplication calculation of both dropdown list will happen internally. Eralier we have severity and occurrence both as numeric but now both are changed as dropdown list.

 

Could you please help in this

 

 

1 answer

2 votes
Tomislav Tobijas _Koios_
Atlassian Partner
January 4, 2025

Hi @thumuluru_shreya ,

One way you could do this is by using Lookup table actions for 'mapping' select list options with specific (number) values.

For example, create two lookup tables for each select list field (one for Severity and one for Occurrence):

 2025-01-04 10-00-16.png 2025-01-04 10-00-20.png

And then, assuming 'output' field is a number type field, you can use automation math expressions to calculate desired value:

2025-01-04 10-00-50.png

In this example (as stated in your question), I've simply multiplied Severity * Occurrence values by using the following expression:

{{#=}}{{severity.get(issue.customfield_10367)}} * {{occurence.get(issue.customfield_10368)}}{{/}}

Of course, you can name those Lookup tables as you wish, and you need to use appropriate custom field IDs for Severity and Occurrence field that you're using.

Hope this helps.

Cheers,
Tobi

thumuluru_shreya
Contributor
January 4, 2025

@Tomislav Tobijas _Koios_ , Thanks for helping.

I didnt get any ouput for this. Could you help in this?

Tomislav Tobijas _Koios_
Atlassian Partner
January 5, 2025

@thumuluru_shreya can you share some screenshots of automation rule and actions you're using (together with smart values and expressions within the rule)?

Additionally, I would suggest using Log action to check out smart values, calculations, outputs and any other values you can get within the automation rule to debug rules which you're testing.

thumuluru_shreya
Contributor
January 5, 2025

@Tomislav Tobijas _Koios_ , Could you please check and let me know

Screenshot (1038).png

Tomislav Tobijas _Koios_
Atlassian Partner
January 5, 2025

@thumuluru_shreya can you confirm those are correct IDs for severity and occurrence custom fields? Also, as you stated, these fields are single select custom fields?

👉 I would suggest creating additional log actions for both {{issue.customfield_10324}} and {{issue.customfield_10325}} to see if you're getting correct values there.

Also, can you provide screenshot(s) of rule audit log afterward?

thumuluru_shreya
Contributor
January 5, 2025

@Tomislav Tobijas _Koios_ , 

can you confirm those are correct IDs for severity and occurrence custom fields?Correct Also, as you stated, these fields are single select custom fields? Yes, Dropdown with single select

👉 I would suggest creating additional log actions for both {{issue.customfield_10324}} and {{issue.customfield_10325}} to see if you're getting correct values there.- Could you please explain with steps

Also, can you provide screenshot(s) of rule audit log afterward?

Screenshot (1039).png

Tomislav Tobijas _Koios_
Atlassian Partner
January 5, 2025

@thumuluru_shreya thanks!

As for logging values for custom fields, I was thinking of adding two Log actions.

  1. Add Log action for Severity and Occurrence fields.2025-01-05 18-51-40.png
  2. Run the rule on one issue that has Severity and Occurrence field values.
  3. Navigate to the rule Audit log (see screenshot below) and expand the last execution log. There, you should be able to see what your rule is fetching within those Log actions.2025-01-05 18-56-09.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events