I am looking to sum the values of these 4 fields into the field outlined in the box. I am very new to Jira Automation and these seems incredibly simple so any help would be appreciated from the community. Thanks!
Hi @Eric Lynch, you might try something like this:
Use the Edit issue action within the automation rule.
Apply this smart value formula as the new value for the Aggregate Risk Score field (i.e. replace yellow marking in the image below).
{{#=}}{{issue.Likelihood Score}} + {{issue.Impact Score}} + {{issue.Ease of Detection Score}} + {{issue.Proximity Score}} {{/}}
More information about smart values functions
TimK
Hi @Eric Lynch
Adding to Tim's answer...
What are the types of your custom fields?
{{issue.somefield.plus(issue.anotherfield)}}
{{#=}} {{issue.somefield.value}} + {{issue.anotherfield.value}} {{/}}
Next thing, to avoid problems I recommend confirming the smart values for those fields before trying to add them...
Smart values for fields are name, spacing, and case-sensitive. And often the smart value does not match the displayed field name on the issue views. The how-to article below helps to identify the correct smart value (and custom field id) for any supported fields for automation rules.
The essential steps are:
https://<yourinstanceurl>/rest/api/2/issue/<issuekey>?expand=names
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
Finally, what do you want to happen if a value has not yet been set / selected for one of the fields? Should it default to 0, prevent the sum calculation, etc.?
If you want the values to default to 0, that can be added with |0 as in this example:
{{#=}} {{issue.somefield|0}} + {{issue.anotherfield|0}} {{/}}
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.