Automation to calculate Risk Priority is not working

Shannon Bradley November 16, 2023

I have set up an automation so that when:

Risk Impact value > 0

Risk Probability > 0

Then edit Priority to be equal to: {{#=}}{{issue.Risk_Impact_Value.value}} * {{issue.Risk_Probability_Value.value}}{{/}}

RiskRegister.png

This gets errors

errors.png

can someone help me figure out what is wrong with my automation?

 

Thank you!

1 answer

1 accepted

1 vote
Answer accepted
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.
November 16, 2023

Hi @Shannon Bradley 

That error is telling you the math expression's inputs collapsed to null, leaving only the * remaining.

What are the types of your fields?  If they are numeric, please remove the .value from each of those fields in the math expression, as that is used for selection fields (i.e., drop-down lists).

{{#=}}{{issue.Risk_Impact_Value}} * {{issue.Risk_Probability_Value}}{{/}}

 

If that does not help, it is possible the smart values are incorrect for the fields.  Smart values are name, spacing, and case-sensitive, and they often do not match the displayed name on the issue views.

To confirm your smart values for the fields, please use this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Essentially you find an example issue with your fields, call a REST API function from a browser tab, and search for your fields on the page (e.g., with CTRL-F) to find the correct smart values (or the custom field id).

 

Kind regards,
Bill

Shannon Bradley November 16, 2023

Thank you so much!  The smart values were correct.  It was the ".value" at the end of the field names that was causing the problem.

The automation runs and succeeds now :)

It takes a while - so I am assuming it is calculating the values throughout my whole risk register and not just the single task/risk that I am testing it from.

But anyway - it works!  Thank you!

Like Bill Sheboy 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.
November 16, 2023

I am glad to learn that helped.

And...you note wanting to do this for "my whole risk register".  Are you running this as a manual rule or as a scheduled rule to catch-up and set the field?

 

And...after your data is caught-up, you may want to consider...

  1. When should this run / calculate the Calculated_Priority: when any of the three fields change?  (That would help with any manual changes to the result.)
  2. Or, something else?

If it is the first one, perhaps use a trigger to detect changes to any of the fields to decide / perform a re-calculation.

Shannon Bradley November 16, 2023

This was originally a manual run only, but now that it is working - I have it triggered on change for either of the two input fields and that works now as well!

Suggest an answer

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

Atlassian Community Events