Sum up Story points to epic
Asked by Elad Ben-Noam:

Hi,

I have many customers that are looking to sum up Story points and other custom number fields from stories to their epics.

Waiting for this feature to be deployed: <https://codebarrel.atlassian.net/browse/AUT-476>

The current status is "deployed to cloud" - is it available for use on Jira cloud? what's the chosen code for that?

Thanks,

Elad.


Answers:
author: Carlos Treminio
body: This rule works on my case and it may help you.

Overview {#toc-hId--1272179696}
-------------------------------

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

Trigger {#toc-hId-1215333137}
-----------------------------

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

Sum the Story Points {#toc-hId--592121326}
------------------------------------------

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

Edit the Epic Story Points {#toc-hId-1895391507}
------------------------------------------------

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

Append the comment {#toc-hId-87937044}
--------------------------------------

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

comments: author: Katherine Japutra
body: This works for me. Thank you.

One question though. How to apply this to more then 1 epic?


author: Sebastian George
body: The way Carlos has this set up is it works for any epic within the given project you're working with and keys off of as soon as a story point value has been updated that has an epic link.

Well done Carlos, thank you for figuring out this functionality.


author: SrikanthNarayan
body: [@Carlos](/t5/user/viewprofilepage/user-id/91653) - Thank you for the screenshots, however i get an error when I use the syntax for Epic link. Any thoughts, please.


author: Andreza Santos
body: [@Carlos Treminio](/t5/user/viewprofilepage/user-id/2198811)

Hi!

For me this solution unfortunately did not work, the automation even runs successfully, but even if the stories are with values greater than 0, the automation is always 0 in the epic, it doesn't work.

Can you help me?

![Captura de Tela 2021-11-19 a?s 11.38.52.png](https://community.atlassian.com/t5/image/serverpage/image-id/170196i39F43CDCE47E88BC/image-size/large?v=v2&px=999 "Captura de Tela 2021-11-19 a?s 11.38.52.png")![Captura de Tela 2021-11-19 a?s 11.39.03.png](https://community.atlassian.com/t5/image/serverpage/image-id/170197iF54944286678001B/image-size/large?v=v2&px=999 "Captura de Tela 2021-11-19 a?s 11.39.03.png")![Captura de Tela 2021-11-19 a?s 11.39.26.png](https://community.atlassian.com/t5/image/serverpage/image-id/170198i004339A66BE9C18F/image-size/large?v=v2&px=999 "Captura de Tela 2021-11-19 a?s 11.39.26.png")


author: Christine Lee
body: [@Andreza Santos](/t5/user/viewprofilepage/user-id/4105298)try using "Parent" instead of "Epic Link" in the **Lookup Issues** component. I had the same zero sum problem, and this change worked for me.


author: Ian Davies
body: [@Carlos Treminio](/t5/user/viewprofilepage/user-id/2198811) your suggestion works a treat. Was struggling to get this working so thank you for the assist


author: Vasanth kumar
body: [@Carlos Treminio](/t5/user/viewprofilepage/user-id/2198811) Thank you for you effort. I followed the same instruction but Epic story point just changed from None to Zero when I changed the one of the story's point.

The automation status is success but Its not summing up the point from stories to Epic.

Can you help with this. Thank you.

![Automation screen shot.png](https://community.atlassian.com/t5/image/serverpage/image-id/263065i8C6E6F89965D83CA/image-size/large?v=v2&px=999 "Automation screen shot.png")


author: Guy Anela
body: Hi [@Vasanth kumar](/t5/user/viewprofilepage/user-id/5243039) -Try changing the JQL in your **Lookup issues** Action to...

```
"Epic Link"={{issue.key}}
```

There are other scenarios to be considered as well which I've commented on below. Hope they help. Cheers!


author: Kathleen B_ Hornilla
body: This still works, thank you so much!


author: Guy Anela
body: Hi folks - I implemented Carlos' solution and it works like a charm! Thanks Carlos! :)

Having said that, I ran into a couple of scenarios where the Story Point totals get misaligned...

1. If you simply remove a Story from an Epic.
2. Or, if you change the **Epic Link** field on an existing Story that already has the Story Point set. Whether you're setting the Epic Link for the first time, assigning it to another Epic, or simply removing it.

In each of the above cases, the Story Point totals do not get updated on the Epic(s).

So, to address these use cases, I created an additional Automation that gets triggered when a Story is updated. It checks to see if the Epic Link was changed, captures the changed To/From values and recalculates the Story Point totals accordingly.

Here are the Automation settings I used...

* **Trigger**: Issue Updated
* **Field Condition**: Type=Story
* **Field Condition**: Story Points is not empty
* **Advanced Compare Condition**: If {{changelog.Epic Link}} does not equal Empty
* **Create Variable Action** :
  * **Name**: EpicLinkChangedTo
  * **SmartValue**: {{changelog.Epic Link.toString}}
* **Create Variable Action** :
  * **Name**: EpicLinkChangedFrom
  * **SmartValue**: {{changelog.Epic Link.fromString}}
* **If/Then Condition:** If {{EpicLinkChangedTo}} does not equal empty
  * **Branch Rule / Related issues:**
    * **Type:**JQL
    * **JQL**: Key={{EpicLinkChangedTo}}
  * **Lookup Issues Action** :
    * **JQL**: "Epic Link"={{EpicLinkChangedTo}}
  * **Edit Issue Action** :
    * Story Points: {{lookupIssues.Story Points.sum}}
  * **Add Comment Action** :
    * {panel:bgColor=#e3fcef}  
      \*{{initiator.displayName}}\* has updated the \*Epic Link\* on {{triggerIssue.key}} so the total Story Points on this Epic has been adjusted to \*{{lookupIssues.Story Points.sum}}\*.  
      {panel}
* **If/Then Condition:** If {{EpicLinkChangedFrom}} does not equal empty
  * **Branch Rule / Related issues:**
    * **Type:**JQL
    * **JQL**: Key={{EpicLinkChangedFrom}}
  * **Lookup Issues Action** :
    * **JQL**: "Epic Link"={{EpicLinkChangedFrom}}
  * **Edit Issue Action** :
    * Story Points: {{lookupIssues.Story Points.sum}}
  * **Add Comment Action** :
    * {panel:bgColor=#e3fcef}  
      \*{{initiator.displayName}}\* has updated the \*Epic Link\* on {{triggerIssue.key}} so the total Story Points on this Epic has been adjusted to \*{{lookupIssues.Story Points.sum}}\*.  
      {panel}

I hope this helps!!! ...Cheers! :)

comments: author: Didi Goldbart
body: [@Guy Anela](/t5/user/viewprofilepage/user-id/4660450)

Thank you very much for this detailed automation.

One question though: when I create the Branch Rule inside the "If/Then" block, it opens a new nested branch ("For JQL"). Should the following statements be inside that nested branch?

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


author: Guy Anela
body: Hi [@Didi Goldbart](/t5/user/viewprofilepage/user-id/4881461) - Yes, that is correct. ...you'll have two separate IF blocks, one for the **EpicLinkChangedTo** (just as you depicted above), and another for the **EpicLinkChangedFrom**. Here's a screenshot of the entire Automation Rule...

![AutomationRule-SumPointsWhenEpicLinkChanges.png](https://community.atlassian.com/t5/image/serverpage/image-id/193277iBACD0A663110B120/image-size/large?v=v2&px=999 "AutomationRule-SumPointsWhenEpicLinkChanges.png")

Also, I ended up adding a 3rd Automation to handle the use case where a child ticket gets **Deleted**. Here's a screenshot of that Automation Rule as well...

![AutomationRule-SumPointsWhenIssueDeleted.png](https://community.atlassian.com/t5/image/serverpage/image-id/193276i309832369EB73550/image-size/large?v=v2&px=999 "AutomationRule-SumPointsWhenIssueDeleted.png")

I hope these help. Cheers!


author: Didi Goldbart
body: [@Guy Anela](/t5/user/viewprofilepage/user-id/4660450) - This is very helpful, thank you very much (great catch adding the deleted child rule)!

I'm having some issues with the 2nd automation, its seems that an error occurred. I went over the definitions and they seems correct. Do you have any idea how do I inspect those errors? I couldn't find a log or other entry with the error details.


author: Guy Anela
body: Hi [@Didi Goldbart](/t5/user/viewprofilepage/user-id/4881461) - Glad it was helpful.

As far as the error, you should be able to track things down by viewing the **Audit log** . You can expand the **Show more** information for the specific execution and see the Conditions that were met and the Actions that were taken...

![AutomationRule-AuditLog.png](https://community.atlassian.com/t5/image/serverpage/image-id/193293i021FEA70EA29FB66/image-size/large?v=v2&px=999 "AutomationRule-AuditLog.png")


author: Nour Durra
body: Hi [@Guy Anela](/t5/user/viewprofilepage/user-id/4660450)

Thanks a lot for this, it's awesome.

I am getting an error that I am unable to debug, although the automation is doing what it should

![Screenshot 2022-07-10 at 23.14.23.png](https://community.atlassian.com/t5/image/serverpage/image-id/205356i218C0C447A2A38D7/image-size/large?v=v2&px=999 "Screenshot 2022-07-10 at 23.14.23.png")

and this is my automation, am I missing anything here? thanks a lot

![screencapture-forbesmedia-atlassian-net-jira-software-c-projects-JT-settings-automate-2022-07-10-23_21_18.png](https://community.atlassian.com/t5/image/serverpage/image-id/205358i20DD3517C6DBD17F/image-size/large?v=v2&px=999 "screencapture-forbesmedia-atlassian-net-jira-software-c-projects-JT-settings-automate-2022-07-10-23_21_18.png")


author: Guy Anela
body: Hey [@Nour Durra](/t5/user/viewprofilepage/user-id/557077) - You're more than welcome! :)

As far as the error, which **For JQL** Branch is it failing in? There are two, one for the **EpicLinkChangedFrom** and the other for **EpicLinkChangedTo**. I would suggest adding some Logging Actions to log the variable values getting passed before and after it enters the loop. Like this...

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

Hopefully the logging will give you some clues.


author: Katja Arendt
body: [@Nour Durra](/t5/user/viewprofilepage/user-id/557077)

Have you found a solution to your problem. I also tried the second Automation Rule and get the same error as you.


author: David Hartman
body: I'm also having the same issue. It seems like the comparison of **{{changelog.Epic Link}} does not equal Empty** is not working as expected


author: David Hartman
body: I only get this error when I remove an Epic Link from a ticket


author: David Hartman
body: Ah figured it out. Silly mistake. When you are comparing the value of {{changelog.Epic Link}} you don't actually type "Empty" you just leave the field *empty*


author: Dick
body: [@Guy Anela](/t5/user/viewprofilepage/user-id/735086)   
For me, the {{changelog.Epic Link.fromString}} is not filled with the preceding epic link. It prevents me to do calculations for the original epic (prior to changing the issue's epic link).   

As Atlassian is busy with changes regarding the parent / parent link / epic link, I've tried multiple ways to get this going (see below). Sadly to no avail yet (all return null)   

{{changelog.Epic Link.fromString}}  

{{changelog.parent.fromString}}

{{changelog.parent link.fromString}}

{{#changelog.Epic Link}}{{fromString}}{{/}}

{{#changelog.parent}}{{fromString}}{{/}}

{{#changelog.parent link}}{{fromString}}{{/}}

Am I doing something wrong, is there a new syntax ?


author: Ben Buck
body: I just found this handy article <https://confluence.atlassian.com/jirakb/automation-smart-value-to-fetch-the-current-and-the-last-changed-parent-key-1369637055.html> which explains how to get the new and previous parent

To: {{changelog.IssueParentAssociation.toString}}

From: {{changelog.IssueParentAssociation.fromString}}


author: Lauren Pennisi
body: In the meantime, you can see total number of story points on an epic by following these steps:

1. From your board, click Backlog.
2. Click Epics panel.
3. Click on an epic. You will see total story points for all tickets in the selected epic that are in the same Jira project as the epic. Any ticket with a different issue key will not be included in the total. In the example (screenshot) MGRMODS-208 has 9 issues but only 4 are also MGRMODS issues and those tickets total 26 story points.

![Epic total points.png](https://community.atlassian.com/t5/image/serverpage/image-id/96621i0C00BBA18851C6FB/image-size/large?v=v2&px=999 "Epic total points.png")

comments: author: Ashish Jere
body: [John McKiernan](https://community.atlassian.com/t5/user/viewprofilepage/user-id/3613862) Can you please confirm the above is the right way to get the total story points on an epic?


author: Leslie Timm
body: I don't see this view anymore either :(


author: Lauren Pennisi
body: Looks like this is the new paid feature: <https://epicsumup.com/>


author: Josh McManus
body: So I've had a version of this automation running for a while now for my teams, however just recently there's been a discovery that it's undercounting story points because we have Epics with \>100 child issues...meaning we are hitting that 100 issue query limit in the Lookup component. Does anyone have any ideas on how we might be able to circumvent that issue or how we might be able to calculate differently as a workaround?

Thanks!


author: Guy Anela
body: Hi All - In regards to summing up Story Points for an Epic, a few teams just reported to me that the Story Points are being double counted on the **Release Burndown Report** now (once for the Stories and again for the summed up value on the Epic).

Have any of you come across this? If so, how are you handling it?

comments: author: Guy Anela
body: Just a heads up, we addressed this by removing the **Fix Version** values from the **Epics**. It's not critical for our teams to track the Fix Version at the Epic level as long as its tracked on the child issues (Stories, Bugs, Tasks, etc.).

Once the Fix Version values were removed from the Epics, the **Release Burndown Report** calculated the Story Points correctly.


author: John McKiernan
body: Hi [@Elad Ben-Noam](/t5/user/viewprofilepage/user-id/2466213) ,

Thanks for your message. John from the automation team here.

This new feature has indeed shipped last week. We are just putting a blog together right now to inform customers.

We will also be running through this new feature in a webinar on June 11th: [https://www.atlassian.com/webinars/software/how-to-supercharge-your-automation-in-jira-cloud](https://www.atlassian.com/webinars/software/how-to-supercharge-your-automation-in-jira-cloud?)

Below is the smart value you could use. However, keep in mind that at the moment it will only work for summing up subtasks to the parent rather than stories to the Epic.

![2156cf3c-f624-42ab-b451-a4fc87777e9c.png](https://community.atlassian.com/t5/image/serverpage/image-id/96548i9D2E00F68582D96E/image-size/large?v=v2&px=999 "2156cf3c-f624-42ab-b451-a4fc87777e9c.png")Hope that helps but any questions, just let me know.

John

comments: author: Sebastian Nordin
body: That is great! [@John McKiernan](/t5/user/viewprofilepage/user-id/3613862) when is it planned to add support for summing up values from stories on epic level?


author: John McKiernan
body: Glad it solves a problem [@Sebastian Nordin](/t5/user/viewprofilepage/user-id/2098731) !

I haven't got a date for this just yet but will make sure to update this page once that ships :)


author: Sameer P
body: Hi John - Any updates on when JIRA will support summing up values from stories/tasks/sub-tasks on epic level?


author: John McKiernan
body: I'm afraid not [@Sameer P](/t5/user/viewprofilepage/user-id/4125581) though if you check out the comments on this post from the engineer who built it, you might find a workaround: <https://community.atlassian.com/t5/Automation-articles/How-to-sum-up-logged-hours-using-automation-in-Jira-Cloud/ba-p/1409115>


author: edwardotis
body: [@John McKiernan](/t5/user/viewprofilepage/user-id/3613862) Can you please give a 2022 update on this feature? I tried your smart sum on a simple parent/child task relationship and it fails with the error: is not a number


author: Peter Kerrigan
body: [@edwardotis](/t5/user/viewprofilepage/user-id/4849380) are you looking for the feature that will sum up from stories to epics?


author: Dave Forsyth
body: JIRA has a template for Parent (FKA Epic) story point updating. You can start with this and make whatever updates you want to it. I found it helpful with the new paradigm where Parent is replacing Epic, Epic Link, and Parent Link.   

It still needs to be copied and adjusted to handle updating the former Parent when a Parent is changed.   
![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/295640i8F274ED60AD95AE2/image-size/large?v=v2&px=999 "image.png")


author: Andrew
body: There is a plugin which shows total story points and total time estimate for epic [https://marketplace.atlassian.com/apps/1231982/epic-insights-issue-view-for-jira?tab=overview\&hosting=cloud](https://marketplace.atlassian.com/apps/1231982/epic-insights-issue-view-for-jira?tab=overview&hosting=cloud)


author: Dawn Rodney
body: [@Guy Anela](/t5/user/viewprofilepage/user-id/735086) I had a few questions about your If/Then statement. When I attempted the If: matches, do I want to Run actions if... All conditions match or At least one condition matches

![Screen Shot on 2023-06-16 at 12-39-39.png](https://community.atlassian.com/t5/image/serverpage/image-id/263662i130F505D66F4D3C6/image-size/large?v=v2&px=999 "Screen Shot on 2023-06-16 at 12-39-39.png")

And my second question, when I tried to just copy the If: matches {{EpicLinkChangedTo}} to create the If: matches {{EpicLinkChangedFrom}}, the automation created a Else-if: matches instead of just an If: match. I tried editing it and looking for other options for If but didn't see any other options.

Any ideas on what I did incorrectly? Here is the part of the automation.

![Screen Shot on 2023-06-16 at 12-40-38.png](https://community.atlassian.com/t5/image/serverpage/image-id/263663i0FD274E556A53D78/image-size/large?v=v2&px=999 "Screen Shot on 2023-06-16 at 12-40-38.png")

Here is my complete rule

![Screen Shot on 2023-06-16 at 12-45-01.png](https://community.atlassian.com/t5/image/serverpage/image-id/263664iA0F9111DD1F5E237/image-size/large?v=v2&px=999 "Screen Shot on 2023-06-16 at 12-45-01.png")

comments: author: Guy Anela
body: Hi [@Dawn Rodney](/t5/user/viewprofilepage/user-id/3602986) - In regards to your first question, there's only 1 **Condition** in that IF block so it shouldn't matter. :) I would just leave it set to "All conditions match". Now, if you later decide to add additional Conditions, then you would want to choose the appropriate one.

In regards to your second question, I would manually add the IF Condition instead of copying the original one. You would just click on the **New Component** at this level...

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

If you still have the **Else-if** there, you should be able to drag/drop its internal components into the new **If** . Once you're done moving them, you can delete the **Else-if**.

I hope this helps. :)


author: Dawn Rodney
body: [@Guy Anela](/t5/user/viewprofilepage/user-id/735086) Yes, thank you. That was super helpful. I wasn't able to "move" it but I just deleted it and add a new component. It is really odd, that I can't copy it and then edit it. Oh the fun quirks of Jira administration... ;-)

I do have edge case that I am in the process of testing. Wondering if anyone ran into this one too.

If I update the Epic Link field in a ticket (that is currently in an Epic) and just update the field by selecting a new Epic in the drop-down. I DON'T actually clear the Epic Field before adding the additional Epic, it then fails. I assume that Jira does not seem to log that the Epic Field is not empty??? :shrug: Any ideas?

![Annotation-Annotation on 2023-06-20 at 15-33-35.png.png](https://community.atlassian.com/t5/image/serverpage/image-id/264186i5A58E8094785BC56/image-size/large?v=v2&px=999 "Annotation-Annotation on 2023-06-20 at 15-33-35.png.png")


author: Peter Kerrigan
body: I am just implementing something like this for my client. The original automation outlined by [@Carlos Treminio](/t5/user/viewprofilepage/user-id/2198811) worked perfectly for me!

I added one additional condition though as my client wanted to exclude any issues that are in the "Done" status category. Thought I'd share in case others are interested in the same use case.

In order to achieve this I:

1. Added the "Status" field to the automation trigger to monitor it for changes
2. Updated the "Then: Lookup issues" JQL to be ***"Epic Link" = {{issue.key}} and statusCategory != Done***

This will monitor the Status of issues and exclude the story points of those issues that are closed.


author: bmacd
body: I followed this video and the automation kicked in but for some reason it makes the story points in the Epic 20 points regardless of how many points I put in the tasks. Any ideas?

comments: author: bmacd
body: In the Epic I get 20 points, so I went through the issues and added silly points like 88 and 23 and I get the correct number in the 'estimate' field but not in the Story Point field.

![story points 20.png](https://community.atlassian.com/t5/image/serverpage/image-id/173993i7C4AB4B1C2F1B33C/image-size/large?v=v2&px=999 "story points 20.png")![story points 207.png](https://community.atlassian.com/t5/image/serverpage/image-id/173994i516EBD8904081075/image-size/large?v=v2&px=999 "story points 207.png")


author: Rahul_RVS_Support
body: removed - posted mistakenly


author: Alex Fairweather
body: **Epic status by Story Points** report in Jira that can also be displayed in Confluence

* I can solve this in Jira Server edition. But you need to have deployed Dataplane reporting plugin
* See[bottom of this link](https://community.atlassian.com/t5/Jira-Questions/Sum-Story-Points-to-Epic/qaq-p/355859) with "Alex Fairweather" reply and configuration instructions


Tags: atl-curate