Sum up story points from all epics to parent issue
Asked by Joost Klykens:

Hi,

I would like to sum up the story points from all epics to their parent issue. The previous admin created a parent level (standard issue types, he called 'feature') above epic level to reflect the application structures. All applications are first divided into modules (-\> feature) and then into functionalities (-\> epic).

I got the sum-up automatisation for subtasks to stories and for stories to epics but don't find anywhere how to sum-up the epics story points into the 'feature' issue type. I suppose it should be a variation on the sum-up of subtasks to stories but can't get it working.

Current formula in 'Edit issue Advanced' is (previous part is when value changes for Story Points, branch rule = 'For Parent'):

{  
"fields": {  
"customfield_10032": {{#=}}{{epics.customfield_10032.join(" + ")}}  
{{/}}

}  
}

'customfield_10032' = 'Story Points' field

'epics' in the formula is variation on 'subtasks' I use this to sum up subtasks to stories and there it works. In my case the epics are subtasks from my 'feature' level but of course this doesn't work...

Anybody who can help with this please? I would


Answers:
author: Bill Sheboy
body: Hi [@Joost Klykens](/t5/user/viewprofilepage/user-id/4355036)

To do this with automation, I recommend using a JQL statement to gather the epics with the [Lookup Issues action](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--lookupIssues--). You may then get the sum with: {{lookupIssues.Story points.sum\|0}}

Kind regards,  
Bill

comments: author: Joost Klykens
body: Hi Bill,

Thank you for the quick response. Could you give some more details please since I can't get it working and did try different variations of Lookup Issues action. Added a picture of the latest variation.

![sumup epic points.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/172194i2AC1A521B92EC6F6/image-size/large?v=v2&px=999 "sumup epic points.jpg")

Thank you very much in advance,

Joost


author: Bill Sheboy
body: Hi, Joost.

You are very close to solving this! The key here is how do you connect your features and epics: custom field, parent, link etc.? Then write a JQL statement that selects all the siblings.

For an example patterned from your rule image and assuming use of Parent Link:

* trigger: story points change
* condition: issue type is epic
* lookup issues on JQL to get the siblings: "Parent Link" = {{triggerIssue.Parent Link}}
* branch on JQL to select the feature: key = {{triggerIssue.Parent Link}}
  * action: edit the story points in the feature to be the sum from the lookup
    * {{lookupIssues.Story points.sum\|0}}

Please review/update the JQL expressions if you want to add other conditions.


author: Joost Klykens
body: Hello Bill,

Apology for the late reply due to sickness. I (of course) made it at first too difficult but got it now and it worked for the level above also! My solution in screenshot, I hope it's a good approach since I didn't use JQL before. Triggering from sub-task to feature works like a charme!

![Epic to Feature SP sumup.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/172858iF375C6715FE97C1D/image-size/large?v=v2&px=999 "Epic to Feature SP sumup.JPG")

Thank you very much,

Joost


author: Bill Sheboy
body: Well done! Please consider marking this question as answered to help others find solutions faster in the future. Thanks!


author: Tim Lankford
body: [@Joost Klykens](/t5/user/viewprofilepage/user-id/4355036) [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)

Thanks for this post! I was searching for awhile and trying different automation methods to do this but the method above worked!

Thanks again,

Tim


author: Sarah Shoemaker
body: Hello, I have a slight variation on this question. I'd like to Sum up the points from the Epics \*only if\* they match a certain custom field.

So if the total story points is 100, I'd like to know (perhaps in another field) if 50 of them are from Epics with a "Q3" label.

Is this possible?


author: Bill Sheboy
body: Hi [@Sarah Shoemaker](/t5/user/viewprofilepage/user-id/5312218) -- Welcome to the Atlassian Community!

First thing, please consider making a new question for something like this...and linking back to this original thread. Otherwise only the people following this older one will see your question to offer suggestions. Thanks!

Back to your question...

If you are using Jira Cloud (or Jira Data Center) versions of automation rules, you have the Lookup Issues action with JQL. And so you could add that check on labels to the JQL to limit the issues summed up. Another way to do this is to with smart value, list filtering and math expressions.

Kind regards,  
Bill


author: Sarah Shoemaker
body: Thanks Bill! Appreciate your quick response. I've asked my question more specifically here.

<https://community.atlassian.com/t5/Jira-questions/Can-I-sum-story-points-from-different-projects-in-each-Epic/qaq-p/2472545>


author: Jordan Richter
body: This method works for me. I'm using this to sum all child Epics' story points to the parent Initiative's story points field. This is in tandem with Advanced Roadmaps, so I'm using the Parent Link field instead of an Issue Link fields.  

![Story points from Epics to Initiative.png](https://community.atlassian.com/t5/image/serverpage/image-id/286823i436D123A5AD4CA62/image-size/large?v=v2&px=999 "Story points from Epics to Initiative.png")