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:
How can I calculate the total (SUM) from multiple child issues?
What would the correct automation structure or branching look like (including a visual diagram if possible)?
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!
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Please post an image of your current, updated rule.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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).
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.