Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation, the problem of summing up the amounts

jack January 22, 2023

Hi I'm writing an automation program and I want to calculate the sum of a numeric field in a question. For example, I have a question field as the total value of the amount, each time a new question amount number field is created, this new amount value can be added to the total amount value, and the total amount number field is updated. How should I do it?

1 answer

1 accepted

1 vote
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 22, 2023

Hi @jack and welcome to the community,

You have to have two separate numeric custom fields for that matter. One will be the Total and one will be that of the individual question. Each new number on the individual question will be a part of the Total.

To get this sum you can use a Jira Automation rule and smart values. Your rule should look something like the following:

sum numbers rule.png

Of course feel free to change the trigger and the lookupissue JQL to match your needs. The last component is the log of the sum.

jack January 23, 2023

Hi Alex thanks for your reply.

My jira version is data center version There is no Then:{{lookupIssues}}  Can I still use those conditions?

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 23, 2023

Ohh crap. I missed that little piece of information you provided..

Unfortunately lookupissues is not available on server/DC (https://jira.atlassian.com/browse/JIRAAUTOSERVER-53)

Do you have any 3rd party app like scriptrunner? The latter has a functionality called scripted fields.

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 23, 2023
jack January 24, 2023

Thanks Alex.

There is a scriptrunner plug-in, but I don't know how to write the code content. Is there a detailed tutorial?

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 24, 2023

Yes, in the link above :) 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events