How to sum up story points for initiative?
Asked by Angel Todorov:

Hi there, we recently upgraded to Premium with the idea to use Advanced Roadmaps.

I already created Initiative as a new issue type and configure its usage in hierarchy, so basically, we have at the moment

Initiative

Epic

Story

Subtasks

So far so good.

The next thing I would like to achieve is to sum up story points (SP) from each Story way to to initiative.

From what I can figure out, this should be two step process:

1. Sum up all SP from all Stories within Epic

2. Sum up all Epic SP for each Initiative

Now, for #1, there is one useful link <https://community.atlassian.com/t5/Automation-questions/Sum-up-Story-points-to-epic/qaq-p/1389224>, which allows me to sum up SP for all stories within each Epic.

However, I stuck for #2. I have two bummers atm:

1. I cannot figure out how to show Story Points field on Initiative screen. I can see Story point estimate though

2. I cannot figure out how to amend the automated rule from above to make it sums up SP from Epics for each Initiative.


Answers:
author: Jordan Richter
body: This works great for me. Definitely don't need to script anything.  

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


author: Kathryn Vargas _Tempo_
body: Hi [@Angel Todorov](/t5/user/viewprofilepage/user-id/4870349),   

I know you mentioned you recently upgraded to Jira Premium to try Advanced Roadmaps, but in addition to what [@Prince Nyeche](/t5/user/viewprofilepage/user-id/1928483) mentioned, another app/approach that could help is Structure.   

[Structure](https://marketplace.atlassian.com/apps/34717/structure-flexible-portfolio-project-management-for-jira?tab=overview&hosting=cloud) lets you organize and view your Jira the way you need. With it you can build any hierarchy you like with the levels you need (e.g. for release planning, like the one below) and add any Jira field as a column.   

![structure-release-planning-hierarchy-example.png](https://community.atlassian.com/t5/image/serverpage/image-id/201859iD941132DFEDB91F9/image-size/large?v=v2&px=999 "structure-release-planning-hierarchy-example.png")  

Structure can sum up values in any column that contains numeric values, like Story Points and Estimates. All you need to do is check the "Sum over sub-items" checkbox and the values will be summed up at the Epic, Initiative, and Theme levels, as seen below:   

![summing-up-values.gif](https://community.atlassian.com/t5/image/serverpage/image-id/201861i9789EEBDDBD6512D/image-size/large?v=v2&px=999 "summing-up-values.gif")  

Disclaimer: I'm part of the Structure team, but I hope this helps in case you're unable to find a solution in AR.   

Best,   
Kathryn

comments: author: Doug Levitt
body: Hi [@Kathryn Vargas _Tempo_](/t5/user/viewprofilepage/user-id/4593874)

I have seen some videos on Structure. I was wondering if it handles our use case.

We have a hierarchy: Initiatives \> Epics \> Stories \> SubTasks

++But++, we have 25 Teams. Each Story is assigned to one Team. Each Team estimates Stories (using SPs) -- using its own Story Point scale. As such one Team, the Blue Team with 7 Developers may average 55 Story Points/sprint and another Team, the Green Team with 8 Developers may average 105 Story Points/sprint.

Both our Epics and Initiatives span across Teams.

Initiative-1234

* Epic-1
  * Story-1 - Blue Team - 8 SPs
  * Story-2 - Blue Team - 5 SPs
  * Story 3 - Blue Team - 2 SPs
  * Story-4 - Green Team - 8 SPs
  * Story-5 - Green Team - 13 SPs (to be split/broken down)
* Epic-2
  * Story-11 - Blue Team - 8 SPs
  * Story-12 - Blue Team - 5 SPs
  * Story 13 - Yellow Team - 2 SPs
  * Story 14 - Purple Team - 8 SPs
* ...

So, an Initiative can have 10, 20 or even 30 Epics. And Each Epic can have many Stories. And this spans across 25 Teams.

Our goal is to figure out -- best case scenario -- how many Sprints are needed (we do 2 week, synchronized sprints) to complete the identified Stories within a given Initiative based upon prior Velocity (we currently have a Velocity Metric/Squad based upon the average of the past 5 Sprints).

#1 - I need to sum the # of Story Points per Team (e.g. for Initiative Initiative-1234).

#2 -Based upon each Team's estimate, I need to calculate how many Sprints are needed (based upon average velocity) -- for each Team -- to deliver that Initiative.

Then, we would like to do what if planning (e.g. what if we increased the scope of Initiative-1234, by adding Epic-10, Epic-11) - how would that impact the # of Sprints required.

Is this something Structure can help with? Do you have videos/papers documenting this specific (or similar) use case?

Please note: The above would be easy to do, if the LookupIsuses function (in Automation for Jira) supported \> 100 issues. I could simply find all issues under Initiative-1234 where Team = Blue and Sum the SPs. And then store the value per team in our administrative jira project (where we persist sprint, team metrics). But alas, that limitation prevents us from doing this (as each Team could have several 100 Stories per Initiative).

Likewise, we could export this data to excel and do the calculations there. But that is painful.

Thanks,

Doug


author: Kathryn Vargas _Tempo_
body: Hi [@Doug Levitt](/t5/user/viewprofilepage/user-id/3570640),

Thanks for spotting my post -- I realize just now that I hadn't nested it in the right thread!

I consulted my Solutions colleagues on this one. At first glance it is a bit tricky, because it looks like what you want is hierarchy that is Initiative - Teams - Story, which would allow summing up story points in teams under each initiative.

Depending on what connections are there between Initiative, Epic, and Story there might be different approaches how to build this, but one way or another it is possible with the [Formulas feature in Structure](https://wiki.almworks.com/documentation/structure/latest/cloud/formulas-144998671.html). From there, the formula is pretty easy (amount of planned story points / team velocity), but will take hardcoding all 25 teams' velocity inside the formula.

Long story short: it is possible with Structure. If you'd like to dig in more, please write us at solutions@almworks.com and my colleagues will be happy to help explore this approach further.

Hope this helps,   
Kathryn


author: Doug Levitt
body: Hi [@Kathryn Vargas _Tempo_](/t5/user/viewprofilepage/user-id/4593874)

Thanks, I will read about the Formulas. A question, are there any limitations (in terms of # of tickets) that a Formula can work across (e.g. 100, 1000, 10000)? Thanks.

Doug


author: Kathryn Vargas _Tempo_
body: Hi [@Doug Levitt](/t5/user/viewprofilepage/user-id/3570640),   

There are no limitations in Formulas, but Structure itself has limitations: 10,000 issues or rows in Cloud and 100,000 in Data Center/Server.   

Best,   
Kathryn


author: Fabian Lim
body: [@Angel Todorov](/t5/user/viewprofilepage/user-id/4078866) : take a look at this video tutorial that was recently posted: <https://www.youtube.com/watch?v=PROcxEOMyGM>

1. There is a rule to sum up stories to epics

2. For the initiative, use the same rules, but change the condition to issue type 'epic' and change the branch to go to a specific link issue that connects to the initiative.

Original Post:<https://community.atlassian.com/t5/Automation-discussions/Jira-Automation-Complete-Video-Guides-on-how-to-Sum-Up-Story/td-p/1741948>

comments: author: Angel Todorov
body: Thanks for the answer, Fabian. Yes, I figured it out. However, I bumped into another issue - while I am able to sum up SP from Stories and set the value to Epic Story Point, then in the Advanced Roadmap, "Progress (Story Points)" column, for the Epic I see value double - once it is collected from all Stories beneath the Epic and then on top of that, I have SP added from the Epic itself. See the screenshot below:

![epic-stories.png](https://community.atlassian.com/t5/image/serverpage/image-id/150495iE93F236D2DFA9AC1/image-size/large?v=v2&px=999 "epic-stories.png")

How can I avoid such behavior?


author: Curt Holley
body: [@Angel Todorov](/t5/user/viewprofilepage/user-id/4078866) Are you on Jira Cloud Premium, or just cloud, or......??

Regardless, you would need to add the Story Point field to whatever Screen scheme the Initiative issue type is using (you need to be an Admin to do this).

Then, you should be able to sum up the story points from Epic to Initiative by using the lookup issues action and putting {{lookupIssues.Story Points.sum}} into the Story point field of an Edit issue action.

comments: author: Angel Todorov
body: We are on Jira Cloud Premium. Re Story Point field, actually all my issues are sharing the same Issue Screen, however unlike Story, Initiative, Task and Sub-task have only Story point estimate field.

So my question remains - how can I show Story Points field to Initiative, Task and Sub-task?


author: Prince Nyeche
body: Hi [@Angel Todorov](/t5/user/viewprofilepage/user-id/4078866)

I think a more robust way to go about summing up story point across different hierarchies is using ScriptRunner addon.

comments: author: Doug Levitt
body: [@Prince Nyeche](/t5/user/viewprofilepage/user-id/1928483)

I am curious, what ScriptRunner functionality provides this?

Our use case is a tiny bit more complex (than what is mentioned above). We have a similar hierarchy: Initiatives \> Epics \> Stories \> SubTasks

++But++, we have 25 Teams. Each Story is assigned to one Team. Each Team estimates Stories (using SPs). And, naturally, each Team has a different Velocity. And, Epics and Initiatives span across Teams.

For a given Initiative,

#1 - I need to sum the # of Story Points per Team (e.g. for Initiative INIT-1234, the Blue Team has estimated a total of 184 SPs and the Green Team has estimated a total of 225 SPs).

#2 -Based upon each Team's estimate, I need to calculate how many Sprints are needed (based upon average velocity) -- for each Team -- to deliver that Initiative.

I have been evaluating:

a) Automation for Jira - the #lookupissues limitation (of 100 issues) makes this impractical

b) ScriptRunner

c) SumUp

I noticed that the ScriptRunner aggregateExpression doesn't work on the Cloud. So, I was unclear how this would be done (using that tool).

Thanks,

Doug


author: Prince Nyeche
body: Hey [@Doug Levitt](/t5/user/viewprofilepage/user-id/3570640)

You will need to script everything which includes multiple functions that processes request or listens for events. ScriptRunner uses groovy script and part of making it work for you would be to know how to code extensively in groovy. As long as you can do that, you can create your own functions and work across your implementation. I have used ScriptRunner to implement a hierarchy sum up functionality across any number of hierarchy (Including hierarchies created by Advanced roadmaps) and it also works well with Foxly - Backlog prioritizations to calculate Fibonacci sequence.

Subsequently, you can even go outside the realms of addons and create a standalone API (that resides in some PaaS) that can process any request from your Jira instance received via webhooks. So there are several options that are possible when scripting is involved.


author: Doug Levitt
body: Thanks [@Prince Nyeche](/t5/user/viewprofilepage/user-id/1928483)

Thanks for the reply and info. That's sort of what I figured.

Doug