Hi,
I have a Jira Cloud Automation rule that should automatically calculate the sum of Story Points of all child issues and update the Parent issue.
The rule is configured as follows:
The rule works correctly in most cases. However, in some cases the Story Points value in the Parent issue is unexpectedly changed to 0.
I suspect that sometimes {{lookupIssues.Story Points.sum}} returns an empty value, and Jira Automation interprets it as 0.
I also tried using:
{
"fields": {
"Story Points": {{lookupIssues.Story Points.sum|0}}
}
}but I would like to understand the root cause.
Any advice would be appreciated.
Hi @007989
The |0 default makes this worse, not better. When the lookup comes back empty, |0 turns the missing sum into a literal 0. The rule then writes that 0 to the parent.
The empty lookup is the search index lagging behind the trigger, as @Gor Greyan said. You can't fully prevent that, but you can stop it from causing damage. Add an Advanced compare condition between the Lookup and the Edit: {{lookupIssues.size}} greater than 0. When the index is behind, the rule now skips the update instead of writing 0. The next change on any child re-runs the rule and corrects the number. One edge case: if the last child is removed, the rule skips and the old value stays.
If the goal is mainly to see the rollup on the parent, you can also skip the stored field entirely. Disclaimer: I work for Plugio, the vendor of Plugio Panels. It adds a panel to the issue view that sums Story Points over direct children or the full hierarchy. The value is computed live when the issue is opened, so nothing can go stale or reset.
- Issue view
Hi @007989
Welcome to the Atlassian Community!
Your smart value is correct
That behavior is more likely caused by timing/indexing. The rule is triggered immediately after a child Story Points value changes, while the updated work item may not yet be available to the JQL used by Lookup work items.
I would try adding a Re-fetch work item data before the Lookup action.
Also, add a temporary Log action that will confirm whether the 0 is caused by the lookup returning no work items rather than by the sum function.
Found: {{lookupIssues.size}}
Sum: {{lookupIssues.Story Points.sum}}
Regards,
Gor
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.