Forums

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

How to automatically calculate the sum of two values?

Nicolle Diniz February 11, 2022

I have a team-managed project and I have 4 custom fields that indicates cost.

I need one of them (Total) to be the sum of the other three.

I also need this value (Total) to be recalculated whenever I change one of the other three fields.

Which is the easiest way to do that?

2 answers

0 votes
Hassan raza
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!
February 11, 2022

You can check this automation: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/

After read this i hope you solved your issue try this.

0 votes
Jack Brickey
Community Champion
February 11, 2022

Hi @Nicolle Diniz ,

checkout automation - jira-smart-values-math-expressions . You should be able to achieve your goals.

Nicolle Diniz February 11, 2022

Based on this doc, I tried {{#=}}{{issue.Ticket - Implantação.plus(issue.Ticket - Licença anual)}}{{/}} but I can't even save the rule:

image.png

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.
February 11, 2022

Hi @Nicolle Diniz 

If you look at the error messages below the field, it is showing the unknown field "Custom Field Name" in the JSON.  Perhaps clear that information from Additional Fields and get your edit to work first, then try any additional edits.

For your edit of the "Ticket - Total" field, please remove the extra math syntax and try this:

{{issue.Ticket - Implantação.plus(issue.Ticket - Licença anual)}}

And if that does not work, the smart values may not be accepting some of the characters in the field name.  Instead try using the custom field ID values.  You can find them in the admin screens or from trying the steps in this how-to article:

https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Kind regards,
Bill

Like Jack Brickey likes this

Suggest an answer

Log in or Sign up to answer