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.
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.
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:
newParent = {{triggerIssue.parent.key}}parent = {{newParent}}{{triggerIssue.parent}}): Story Points Sum = {{lookupIssues.Story Points.sum|0}}Branch B - update the OLD parent:
oldParent = {{fieldChange.fromString}}parent = {{oldParent}}{{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.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Martin Härri
Welcome to Community :)
Please check below posts that could help you here
https://www.atlassian.com/software/jira/automation-template-library/sum-up-story-points
Thank you,
Prachi
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.