Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Automation: Multiply 2 variables

Sean Curran
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 21, 2024

Hi,

I am trying to calculate a value called product score. Its a simple calculation of:

(High Level Estimate *-1)*Number of customers

I currently have an automation set up to capture the inverse of HLE (High Level Estimate) as a variable using:

{{issue.HLE.multiply(-1)}}

Number of customers is a label field which I have converted to a number in a variable using:

{{issue.Customers.size}} 

I am then updating a field called product score with 

{{#=}}{{InverseOfHLE}}*{{NumberOfCustomers}} {{/}}

However for this I am getting: 

Unknown unary operator * at character position 1: *3

I also tried 

{{#=}}{{InverseOfHLE.multiply({{NumberOfCustomers}})}} {{/}} 

but for this I got :Failed to get value for InverseOfHLE.multiply({{NumberOfCustomers: {{#=}}{{InverseOfHLE.multiply({{NumberOfCustomers}})}} {{/}}

 

It would seem as though I'm trying something that is supported but I have my syntax wrong or there is some other basic error but at the moment I cannot see having read over the available documentation. 

1 answer

1 accepted

1 vote
Answer accepted
Kalyan Sattaluri
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.
March 21, 2024

Hello @Sean Curran 

Welcome. In my experience, you can either use math expression (using {{#=}} tags) or math operations, but not both together.So your second error is valid. First error seems more of a syntax issue.

 

Can you please log below 3 smart values and share screenshot of audit log:

{[issue.HLE}}

{{issue.Customers.size}}

{{#=}} {[issue.HLE}} * -1 * {{issue.Customers.size}}  {{/}}

 

 

Sean Curran
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 21, 2024

Thanks for the help. I didn't exactly work as above but it inspired me to simplify it. 

I created a variable that simply held the value 1 and called it Inverse

Then used 

{{#=}} ({{Inverse}} / {{issue.HLE}} )* {{issue.Customers.size}} {{/}}

This achieved what I was looking for, thank you!

Like # people like this

Suggest an answer

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

Atlassian Community Events