How to update story points for all stories when only one story is being updated?

Rita Arellano
Contributor
November 25, 2024

Hi all, 

I have been able to get all story points to roll-up to the epic and get them all summed at an epic level. Then the Size Estimate field adjusts accordingly - we use this field instead of T-shirt size. 

The problem I am now running into is that, I have story points that were added before the  automation was made active. So I find myself manually updating (re-entering) the story points for each story. 

Is there a way I can create a rule in where if I re-enter the story points for one story then the automation would then go back and check -sum up all the story points that exist for the the stories linked to that epic and therefore I wont have to do each one by one? Help.jpg

2 answers

1 accepted

1 vote
Answer accepted
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.
November 26, 2024

Hi @Rita Arellano 

Your rule is updating the Size Estimate for the Epics, and so you could create a JQL statement to find Epics where the field is empty.

With that JQL, you could use a Scheduled Trigger rule to find / update the Epics:

  • clone your current automation rule, and modify it to process the existing Epics
    • change the trigger to Scheduled and add the JQL; I recommend setting the trigger to every 30 to 60 minutes
    • remove the condition that checks if the issue is a Story
    • move all of the statements inside the branch outside of it, and then remove the branch
    • save / publish the rule
  • now enable the rule and let it run until the Epics are updated and none remain; then disable or delete the rule

Kind regards,
Bill

Rita Arellano
Contributor
November 27, 2024

@Bill Sheboy 

I've tried this, but what I see happening is that the 'Size Estimate' field is getting added accordingly, that does not seem to be the issue, but the story points are not rolling-up to the epic for the older stories that have had their story points added beforehand. When I add a new story points to any of the old stoires, meaning if I edit, then only the story points from the edited story rolls up to the epic - and thus I get the "correct" Size Estimate. 

Thus, I need to manually do this each time - for each story, to have it roll-up. So please advise, if now I have lost track, but this is what I think I need, but the issue with automation is that it does not iterate through every story already existing... it just takes into account the new story points that were either just added or edited... 

Trigger: Value changes for, Story Points

Condition: Issue Type = Story

Branch to - For Epic (parent)

Action: Lookup issues - "Epic Link" = {{triggerIssue.Epic Link}}

Action: Edit - "Story Points" {{lookupIssues.Story Points.sum|0}}

Dick
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.
November 27, 2024

Action: Lookup issues should be: "Epic Link" = {{issue.key}} as the trigger issue would be the story, not the epic. The branch puts focus on the parent issue, which is then referred to as issue object.

 

As @Bill Sheboy  pointed to me below, the sum part is a List expression, which is indeed perfectly fine without preceeding {{#=}} and closing {{/}} tags. I've adapted this to prevent confusion. 

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.
November 27, 2024

@Rita Arellano -- I am puzzled what you are describing...I thought you had two scenarios (although, actually there are more):

#1) 
GIVEN an issue with an Epic parent
WHEN the issue's Story Points field changes
THEN update the Epic parent to sum the Story Points for all child issues to set the Size Estimate field

 

#2)
GIVEN existing Epics
WHEN the Size Estimate field is empty
THEN update the Epic parent to sum the Story Points for all child issues to set the Size Estimate field

For this second scenario, I was suggesting a rule like this:

  • trigger: scheduled, with JQL to find Epics where the Size Estimate is empty
  • action: lookup issues to gather the child issues in the epic
  • action: edit issue, to set the Size Estimate to the appropriate value

Then allow this rule to run until the Epics are all caught up, and disable it afterwards.

 

The other possible scenarios not handled, and you may decide which ones are needed, possibly by creating additional rules:

  • when a child issue is created and added to an Epic parent at the same time...
  • when a child issue is deleted and was assigned to an Epic parent...
  • when a child issue is removed from its Epic parent...
  • when a child issue is moved to a different Epic parent...
  • when someone manually alters the Size Estimate in an Epic which has child issues...

 

@Dick -- sum is a list function, and it works correctly with the Lookup Issues results for a number field: https://confluence.atlassian.com/automation/jira-smart-values-lists-993924868.html#Jirasmartvalueslists-list.sumlist.sum  There is no need to enclose that in a math expression wrapper.

Like Dick likes this
Rita Arellano
Contributor
November 28, 2024

@Bill Sheboy I would like to isolate one of the problems I am noticing with the older story points not rolling up to the epic. When I manually go and update the story points for these older issues, they do roll-up to the epic, but of course I cant do that for the hundreds of epics that exist. I then created a rule to run every 30 min... to get the story points to roll up. However, nothing takes place, the LOE at an epic level remains at 0. 

Please see my rule and log activity:

I used one epic issue, since I do not want to test this at large. This epic has stories with story points and the story points at an epic level is 0:


1.jpg

2.jpg

3.jpg

 

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.
November 28, 2024

For the rule you show, you do not want the Scheduled Trigger to use the option to "Process all issues produced by this trigger in bulk", so disable that option.

You want the rule to process each Epic found, lookup their children, and then perform the update.  Using the "bulk" option will prevent that from happening.

 

Two more suggested changes:

  • Add to the JQL for the trigger so it only updates Epics which do not have a value in the field to update: Story Points.  Otherwise the rule will never finish as it repeatedly updates the same issues.
  • Next, there is no need for the Re-fetch Issue action in this type of rule, so it may be removed.

 

Rita Arellano
Contributor
December 5, 2024

@Bill Sheboy Yes, this did the trick. I followed your advise, scheduled the trigger: 

*No branching, unchecked "Process all issues produced by this trigger in bulk"

Trigger/Searches: every 30 min

JQL: issuetype = Epic and "Size Estimate" is EMPTY

Then look up Issues: "epic link" = {{issue.key}}

AND: Edit issue fields, Story Points - {{lookupIssues.Story Points.sum|0}}

if: issue matches JQL: "Story Points" >= 0 AND "Story Points" <= 50

Then: Edit issue fields - edit - "Size Estimate" XS





Repeats for every other "Size Estimate" 


Like # people like this
0 votes
Dick
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.
November 26, 2024

Hi @Rita Arellano ,

You can make a manually triggered automation that you invoke using the "More" menu when you have the epic selected that you want to recalculate. The automation would have the same calculations as the automation you already have (for each story point range), though you wouldn't have to branch for the epic as that would be the trigger issue that you use to invoke the automation on.

Hope I'm making sense to you,

Dick

Rita Arellano
Contributor
November 27, 2024

Thats cool, I learned something new here, but It still does not do it, see my replies on this post. 

Suggest an answer

Log in or Sign up to answer