Forums

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

Automation to sum up story points to epic level - how to update previous epic?

Martin Härri
Contributor
December 3, 2024

We want to implement an automation to sum up story points to epic level. So the trigger could be when the field story points is changed or when the field epic link is updated. In this case, the total of story points on epic level should be updated.

So far so good, BUT: what if I move an issue from one epic to the other? This means that the total of the NEW epic should be updated (all fine), but also the total of the PREVIOUS epic (which is now reduced). How can I trigger that, since the old epic link is not not an attribute of the issue anymore.

3 answers

1 vote
Trudy P Claspill
Community Champion
December 3, 2024

Hello @Martin Härri 

If you use the Field Value Changed trigger for the Parent field then you can access the original value of the field. Refer to the {{fieldChange}} smart value described on this page:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/

When you get that value you can use a Branch and use the Advanced Branching on smart value to shift focus to the Epic under which the issue was previously a child.

If that is not sufficient information for you to proceed please provide screen images that show the entire rule you use currently to make the updates when the Epic changes.

 

0 votes
Martin Šenkeřík _Brasscog_
Atlassian Partner
August 15, 2026

Trudy's pointer to {{fieldChange}} is correct. Here's a concrete rule structure that handles both the new and the old parent:

Trigger: Field value changed -> Parent field

Branch A - update the NEW parent:

  • Variable: newParent = {{triggerIssue.parent.key}}
  • Lookup Issues: parent = {{newParent}}
  • Edit issue ({{triggerIssue.parent}}): Story Points Sum = {{lookupIssues.Story Points.sum|0}}

Branch B - update the OLD parent:

  • Variable: oldParent = {{fieldChange.fromString}}
  • Lookup Issues: parent = {{oldParent}}
  • Edit issue ({{oldParent}}): Story Points Sum = {{lookupIssues.Story Points.sum|0}}

One practical caveat: lookupIssues is capped at 100 results per call. If either the new or old parent has more than ~100 children, the recalculated sum will be silently incomplete. For most teams this isn't a problem, but worth knowing before you rely on this in reporting.

If maintaining these two branches (plus the deletion and creation edge cases) feels like more automation than the problem is worth, I released TreeTotals to handle all of this automatically - including the old-parent update when an issue moves. Free up to 10 users, installs in two clicks. (Full disclosure: I'm the developer of TreeTotals.)

0 votes
Prachi Bolar
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 4, 2024

Suggest an answer

Log in or Sign up to answer