Forums

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

Calculate total sum in Jira

Leena Pratheepan
Contributor
January 9, 2024

Hello,

I would like to see the total net amount of the child issues in the epic.

I have tried to create the rule, unfortunately it does not work, although the audit log says that it was successful, can someone help me?

Many thanks in advance.

Note: both custom fields are number fields

 

Best Regars, LeenaBilder_1_2.PNGBilder_1_3.PNGBilder_1_4.PNG

3 answers

1 accepted

1 vote
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.
January 9, 2024

Hi @Leena Pratheepan 

When you branch to the parent issue (i.e., Epic) it cannot see its child issues' data.  Instead try using the Lookup Issues action with JQL to gather the child issues, and then use the sum function: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues

For example...

  • trigger: your field value changed
  • condition: on the issue type
  • branch: to the parent
    • action: lookup issues, with JQL to find the children of the epic
      • project = yourProjectName AND parent = {{issue.key}}
    • action: edit issue (the epic) with the sum of the field
      • {{lookupIssues.customfield_10326.sum|0}}

 

Kind regards,
Bill

Leena Pratheepan
Contributor
January 9, 2024

Hi @Bill Sheboy 

Thank you for your reply. I have tried to rewrite the rule as you suggested. Unfortunately, nothing happens.

The audit log shows that the rule was successful. But only because it removes the value again and reads none.

jira_2.PNG

Jira_Problem_1.PNG

Leena Pratheepan
Contributor
January 10, 2024

Finally it works. Thank you @Bill Sheboy  @Rebekka Heilmann _viadee_ 

jira_33.PNG

Leena Pratheepan
Contributor
January 10, 2024

Why does Jira automation set the values back to zero? Can someone explain this? @Bill Sheboy @Rebekka Heilmann _viadee_ 01.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.
January 10, 2024

The JQL for your Lookup Issues action is using a specific epic, ATP-1, rather than the parent for the branch.  That seems incorrect.

Next, have you checked if there are multiple rules running that could be updating the field?  Please check that by...

  • navigate to the rule list for the project
  • select the audit log
  • look for any rules that ran at the time the field was updated
Like # people like this
Leena Pratheepan
Contributor
January 10, 2024

Thanks @Bill Sheboy 

I use "epic link"={{issue.key}} as JQL for Lookup Issues.

It seems to be work.

Jira_45.PNG

Like # people like this
0 votes
Yonghun Jeong May 28, 2025

As far as I know, lookupIssues doesn't support customfield. It doesn't even need to mention about sum function.

0 votes
Rebekka Heilmann _viadee_
Community Champion
January 9, 2024

Hi @Leena Pratheepan 

can you elaborate on "does not work"? Does it not do anything?

Can you share the Audit Log's Details i.e. "show more"?

Leena Pratheepan
Contributor
January 9, 2024

Hi @Rebekka Heilmann _viadee_  It does not work, which means that the custom field "Total amount" in Epic is not overwritten. Instead, "none" always appears after the rule is triggered.

I would like the net values in the childissue to appear in the custom field "Total amount" in the epic.

Jira_Problem_1.PNG

Suggest an answer

Log in or Sign up to answer