Sintax for performing math operations on Automation

Raúl Eduardo Echeverría Urbina June 22, 2022

Hi, I have the following scenario.  I'm creating an automation rule where I need to get one custom field minus another custom field and then the result multiply it by another custom field.  So far I have this:

{{#=}}{{(issue.customfield_10463}} - {{issue.customfield_10465})} * {{issue.customfield_10466}}{{/}}

Let's say I have these values:

issue.customfield_10463 = 50

issue.customfield_10465 = 40

ssue.customfield_10466 = 12

What I need is to have (50-40)*12 = 120 but I don't know how to group it, and right now it's performing like this: 50-40*12 = -430.

Any help would be appreciated.

1 answer

1 accepted

4 votes
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.
June 22, 2022

Hi @Raúl Eduardo Echeverría Urbina -- Welcome to the Atlassian Community!

Did you copy that smart value expression directly from your rule, or retype it in your post?  I am asking as you have some misplaced parenthesis and curly brackets, so perhaps check that.

You could also do this using the dot-notation to chain the functions, such as:

{{issue.customfield_10463.minus(issue.customfield_10465).multiply(issue.customfield_10466)}}

I believe those process left-to-right rather than in order-of-operations with the {{#=}} syntax.

Kind regards,
Bill

Raúl Eduardo Echeverría Urbina June 22, 2022

Thanks, the dot-notation worked perfectly.

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events