Forums

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

Sum up story points in epic when removing a story

Jan Rosar March 7, 2025

Hi, 

I built an automation to sum up story points in an epic based on this question and the answer from Carlos Treminio.

 

Sum up Story points to epic

As discussed there, this automation doesn't work, when a story gets added or removed to/from an epic. The solution posted by Guy Anela doesn't work for me, because the mentioned smart value {{changelog.Epic Link}} gives nothing back, which I tested by logging it. 

So I tried the following solution for adding a story to an epic, this works great: image.png

When adding a parent issue to a child issue, my idea is, to populate a custom field (customfield_10271) with the issue key of the parent issue, which I can use for the next automation, when I remove the parent issue from a child issue. 

But I'm not quite there yet. When this automation runs, the story points of the epic is always 0, I don't understand, why. 

The automation looks like this: 

image.png

In the log of the smartvalue {{issue.key}} I get the correct issue key of the parent issue, which was removed. In the last step I try to build the sum with {{lookupIssues.Story Points.sum}}, which always is 0. 

Thanks to everyone, who read my question up to this point and I'm happy about every input from the community.

Best regards 

Jan

3 answers

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.
March 7, 2025

Hi @Jan Rosar 

Please note well: parent / child data sum scenarios (e.g., to sum the child Story Points to the Epic Parent) span many possible cases.  This is one of the reason there are marketplace apps to perform this type of field rollup / sync.

Some of the cases can be combined into rules with one trigger and conditional logic while others require their own rules with different triggers.  Deciding which cases to handle will impact which rules to build.

A sampling of the cases around your scenario are:

  1. When a Story is created with a parent Epic set, update the parent's field
  2. When an existing Story with a parent Epic changes its Story Points, update the parent's field
  3. When a Story with a parent Epic is deleted from Jira, update the parent's field
  4. When a Story changes the parent Epic, update both the previous and current parents' fields
  5. When a person alters the Story Points in an Epic, recalculate the total from the child Stories
  6. For all of the above #1-5, decide if an automation rule performs the initiating event, should the rule run (by enabling the Allow Rule Trigger option).  This scenario could create runaway rule looping, halting all rule executions.
  7. When there is an Atlassian automation outage, there is no documentation of which rule events will eventually cause the rules to run and "catch up".  And so it helps to build a Scheduled Trigger rule that can iterate the Epics to catch them up on the child Story sums.  This rule may be left disabled until there is an outage, enabled and run until caught up, and then disabled again.
  8. When some updates occur in rapid succession (e.g., issue import) there can be update "racetrack errors" in automation rules.  While there are mitigations for these there are no guaranteed solutions.  One workaround is after running an import, use the Scheduled Trigger rule described in #7 to ensure the values are correct.

Kind regards,
Bill

0 votes
Pasam Venkateshwarrao
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.
March 7, 2025

Hi @Jan Rosar 

Try this Automation rule

Screenshot 2025-03-07 at 3.23.43 PM.png

 

It will work for sure i tried this it works for me

Jan Rosar March 7, 2025

Hi @Pasam Venkateshwarrao

thank you for your response. Your solution doesn't work for me, because you are checking, whether the story points on an epic are changed. I don't change the story points, but remove a child issue from an epic.

Best regards

Jan

0 votes
Marc - Devoteam
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.
March 7, 2025

Hi @Jan Rosar 

Welcome to the community.

See the following automation rule, of a simple story point sum up in the Epic.

In the lookup action change this to "Parent" = {{issue.key}}

Screenshot 2025-03-07 at 10.48.42.png

You could change the trigger to value change for parent, or use both fields.

Jan Rosar March 7, 2025

Hi @Marc - Devoteam

thank you for your response. 

I'm afraid, your solution doesn't help with my problem, because, I don't change the value of the story points, but remove the child issue from the epic. So this automation wouldn't run in this case. 

Best regards 

Jan

Marc - Devoteam
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.
March 7, 2025

Hi @Jan Rosar 

As I mentioned, in the text, change the trigger to look at the field parent.

Then the automation looks if the parent field is changed, it will continue if the issue is not and Epic, then it will update the Story Points on the Epic.

Adjust the lookup query to "Parent" = {{issue.key}}

Jan Rosar March 7, 2025

Hi @Marc - Devoteam

sorry, when I make your adjustments, it only works for adding a story to an epic. When I remove it, so the field "Parent" is empty, nothing happens. 

And I think, this is correct, because in your automation the branch looks for the parent of the issue. But I removed the parent, so the branch doesn't run, because the trigger issue doesn't meet the condition of the branch.

Marc - Devoteam
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.
March 7, 2025

Hi @Jan Rosar 

This would be correct.

What is the detail of the trigger of the automation, is this based on value deletion?

If so, try the following.

Set the branch to advanced branching and the branch details to:

{{triggerIssue.parent}}, name the variable, then do the lookup en and the edit on story points, does this give a  positive outcome?

Jan Rosar March 7, 2025

Hi @Marc - Devoteam

thanks again, I appreciate your help. 

Yes, the trigger here is "Value deleted" for the field Parent. 

I'm not sure, I follow your latest instruction. When I create a branch like this, I get the error "The provided smart value couldn't be resolved to an object". That is correct as well, because at this point the trigger issue has no parent.

image.png

 

Marc - Devoteam
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.
March 10, 2025

Hi @Jan Rosar 

The only option I can give you is to create a rule based on a scheduled trigger.

Based on a JQL to run over each Eoic and recalculate the story points on the Epic.

Suggest an answer

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

Atlassian Community Events