Forums

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

How to Calculate SUM from Child Issues to Update Parent Using Jira Automation

yones_deliyandra July 8, 2025

Hi everyone,

I'm currently trying to create an automation in Jira that calculates the SUM of a custom field from all child issues (e.g., tasks or sub-tasks) and automatically updates a field in the parent issue with the result.

So far, I haven't been able to configure it correctly. I’m using Jira Automation and would like to ask:

  1. How can I calculate the total (SUM) from multiple child issues?

  2. What would the correct automation structure or branching look like (including a visual diagram if possible)?

  3. What is the correct way to use the SET action on the parent issue based on the value collected from the child issues?

Any examples of the correct smart values or JSON advanced editing would be greatly appreciated.

Thank you in advance for your help!
image.png

4 answers

1 vote
arielei
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.
July 8, 2025

Hello @yones_deliyandra 

Create a var outside the loop and set it to 0.

Then inside the loop add the values to that var by doing something like this:
{{#=}}{{VARNAME} + {{issue.CUSTOMFIELD}}{{/}}

Then, after the loop, update the parent with the var value.

yones_deliyandra July 8, 2025

Hi @arielei 
Sorry, as far as i know, i do updating a variable outside loop (branch) and cannot defining variable set to = 0. so any variable or calculated value inside it doesn’t carry over after the loop ends
If there’s any workaround or a recent update that allows this kind of persistent calculation, I’d really appreciate if you could share more details.

Thank you

arielei
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.
July 9, 2025

Hello @yones_deliyandra 

Yes, sorry for that.

Do the following:
1. Lookup Work-Item and select the parent.

2. Create a var and set its value to {{lookupIssues.Story Points.sum}}

 

This will set your var with the sum of all story points in the parent childs.

from there, you can add it to your parent.

0 votes
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.
July 9, 2025

Hi @yones_deliyandra 

Are you using Jira Cloud or Server / Data Center?

 

For Jira Cloud...

The Lookup Work Items action requires a valid JQL expression, and the one shown for your rule is incorrect.

For the rule you show, please change the JQL to this:

parent = {{issue.key}}

That will find the child issues of the branched-to parent issue, and then the lookup result sum will work.

 

Kind regards,
Bill

yones_deliyandra July 9, 2025

Yes, I’m using Jira Cloud and I’ve already tried the approach you suggested. However, the result in the audit log shows an some errors with the following message:

Unable to run the search while custom values were being defined: .
Custom Smart Value JQL Search: "(parent =) AND (project in (10057))" - Error in JQL Query: Expecting either a value, list or function but got ')'. You must surround ')' in quotation marks to use it as a value. (line 1, character 10)

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.
July 10, 2025

Where did you use that JQL in the rule?  The error indicates there is no value for {{issue.key}} at that point in the rule.

 

For the rule you currently show (as the time of this post on 10 July), the JQL would be with the Lookup Work Items action inside of the branch to parent.  And so that error is not possible when there is a parent.

  • trigger: value changes for your list of fields
  • condition: field Pencapaian (%) is not empty
  • branch: to parent
    • action: lookup work items with that JQL
    • action: edit work item, setting the field to the sum

 

Please post an image of your current, updated rule.

0 votes
arielei
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.
July 9, 2025

Hey @yones_deliyandra 

My answer to you will also work on a custom field

simply run a lookup work-item and then fetch the data like: {{lookupIssues.YourCustomField.sum}}

yones_deliyandra July 9, 2025

yes, it still doesn't work on me. Just to add a bit more context, the data I'm trying to get and sum is dynamic and not manually entered. The field value itself is the result of a calculation using a Smart Value from a separate automation rule.

Could that possibly have an impact on why the current rule is not working as expected?

0 votes
yones_deliyandra July 9, 2025

Hallo @arielei 

Perhaps I should explain it again more clearly and simply from the beginning, and I would really appreciate if someone could help identify whether the issue is coming from the hierarchy configuration or the smart value I’ve used.

I created several child issues under one parent, where each child has a custom field called "Achievement (%)", and the goal is to sum all of these into the parent’s custom field called "Progress Total (%)" (similar to rolling up story points).
image.png

However, the value shown in the parent’s "Progress Total (%)" field is often incorrect — sometimes showing null "add a number", 10, or 20 — even though each child clearly has 20%. For example, with two child issues at 20%, the expected total should be 40%, but that’s not what is reflected.

If anyone has experienced a similar issue, I would truly appreciate it if you could kindly share the step-by-step instructions you followed to resolve it

Thank you in advance

image.png

Suggest an answer

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

Atlassian Community Events