Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to automate the sum of story points for all issues under the epic?

hassan_ahmed February 10, 2021

I would like to know if there is a way I can automate the sum of story points for each issue under the epic?

For example, if I have a task and a bug card each worth 2 story points each, can this be totaled on the epic (parent) level to read 4?

If not possible for all issues, can this be done for tasks only under the epic (not subtasks)? 

Hope this makes sense to more experiences users.

Many thanks

7 answers

1 accepted

4 votes
Answer accepted
Gareth Cantrell
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.
February 10, 2021

@hassan_ahmed you can do this with Automation rules with the following rule, assuming you are using Jira Cloud:

Whenever the Story Points field changes, branch the rule for the related Epic and then sum all the Story Points for issues belonging to the Epic.

The following screenshot show how this would look:

Screenshot 2021-02-10 at 14.01.08.png

hassan_ahmed February 10, 2021

Thank you for the suggestion @Gareth Cantrell . This works great! 

 

Like Gareth Cantrell likes this
Mohini Chandwani February 11, 2021

Hello,

trying to create the same rule but couldn't get this lookup Issue component, is there any other alternative for this.

Can refer the following screenshot of my rule.sum up rule.png

hassan_ahmed February 11, 2021

@Mohini Chandwani Hi Mohini.

  • Remove the "If" issue so the "for epic (parent)" branches off the first step.
  • Then press "new actions" > "lookup issues" and type "Epic Link" = {{issue.key}} > save 
  • "new action" > "edit issue" and search story points
  • type in {{look up issue code}} and save
Like Steffen Opel _Utoolity_ likes this
Mohini Chandwani February 11, 2021

Even after removing the "If" condition didn't get the option of "lookup issues".

look up issue.png

Is this related to scope or access?

hassan_ahmed February 11, 2021

When you press new action you should see these options? 

image.png

Gareth Cantrell
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.
February 11, 2021

@Mohini Chandwani I see you tagged your original question as Cloud, however your screenshot suggests you're using the Server version.

Unfortunately the Lookup issues action is not yet available on the Server version.

This can be achieved in the Server version using a Send web request to query the Jira Software REST API in place of the Lookup issues action.

In the following rule, I'm using a web request to the same Jira instance using the Webhook URL: {{baseUrl}}/rest/agile/1.0/epic/{{issue.key}}/issue?maxResults=100 where {{issue.key}} is referring to the Epic in the branch rule.

You also need to set the Authorization header using base64-encoded credentials of a user with access to the project.

Additionally, you need to select the Wait for response option.

Screenshot 2021-02-11 at 15.14.55.png

The final piece of the puzzle is to use the response from the web request to sum up the story points into the Epic.

In my instance, the custom field id of the Story Points field is customfield_10106.

Screenshot 2021-02-11 at 15.15.09.png

Like # people like this
Mohini Chandwani February 12, 2021

Hello,

I have tried the same, but it throws the error - Response HTTP status : 500 and same Webhook URL run in the browser and getting the data.

And in header I have provided Authorization and encoded {username:password}, other steps are same but still the same error.

 

 

Thank you for your valuable suggestions.

Gareth Cantrell
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.
February 12, 2021

@Mohini Chandwani The only thing I can suggest is to make sure the {{baseUrl}} is what you expect it to be (you can do this using the Log action component).

It can happen depending on how your instance and any proxies are configured, that you may need to use http://localhost:8080 instead of {{baseUrl}}.

Mohini Chandwani February 15, 2021

Thank you @Gareth Cantrell for all your suggestions, the issue was in the baseURL but it is resolved.

Rule is working correct.

 

Thanks.

Like Gareth Cantrell likes this
Mohini Chandwani June 30, 2021

Hello @Gareth Cantrell

Is there any way to send email when rule gets failed or any error occurs.

Can we keep the check for Audit log status whether the rule is ran successfully or some error occured.

I have tried the following approach but it is not sending mail.

mail.png

Any open suggestion with better option which has quick implementation is welcome.

Thanks.

Gareth Cantrell
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.
July 10, 2021

Hi @Mohini Chandwani 

In the rule details section, you can select to be notified if the rule fails and select the rule owner who will receive these notifications as in the below screenshot:

Screenshot 2021-07-10 at 21.02.47.png

Mohini Chandwani July 28, 2021

Hi Gareth Cantrell,

Have tried the same but it is not sending the mail.

Is there any way to access the audit log status value like "SUCCESS" or "SOME ERRORS" so that we can send the mail based on status response, I have tried to console like {{Audit log.Status}} etc various combinations but didn't print anything.

Let me know if it is possible.

 

Thanks for always responding!

Gareth Cantrell
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.
July 30, 2021

@Mohini Chandwani you could try looking at {{webhookResponse.status}} which will return the HTTP Status code for last web request action. 

1 vote
Julien Rey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 11, 2022

Hi everyone, I just wrote a KB article describing how to create an automation rule that will sum up all the story points of stories linked to a parent Epic ticket in Automation for Jira for Server/Data Center.

Can you take a look and let me know if it helps?

https://confluence.atlassian.com/jirakb/automation-rule-to-add-sum-up-story-points-from-all-the-stories-linked-to-an-epic-1108083641.html

Wyner_ Zachary G_ February 8, 2022

@Julien Rey 

 

This method works well, but not for existing epics that have stories with story point values already assigned. This method only adds story points to the epic story point total when the value of story points in a single story is changed. 

It would be helpful to include a way to do a one-time sum of all story points in an epic for existing epics. Once that initial sum is generated, this method works well.

 

Thanks,
Zac

Julien Rey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 10, 2022

@Wyner_ Zachary G_ 

 

Thanks for your feedback. That's a great point indeed. The solution I wrote will only work indeed for freshly created Epic/Stories, but not for ones which already have story points assigned.

It is unfortunately difficult to find a solution without having the lookup method which only exists in Automation for Jira on Cloud :( 

1 vote
Sagar
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 11, 2022

The below automation rule can help here to achieve this on Jira server/datacenter version without using any authentication method.

 

  • WHEN
    • Field value changed: Story Points
  • Issue fields condition
    • Field: Issue type
    • Condition: Equal
    • Value: Story
  • If: matches (you need to add a new if/else block, with an "Advanced compare condition")
    • First value:
      {{fieldChange.fromString}}
      
    • Condition: Equals
    • Second value: empty

Capture 2022-01-11 at 17.44.54.png

    • Add a Branch rule / related issues inside the IF block:
      • Type of related Issues: Epic (parent)
    • THEN (to place inside the branch rule)
      • Choose field to set: Story Points
      • Value:
        {{#=}}{{issue.Story Points}} + {{fieldChange.toString}}{{/}}
        

         

Capture 2022-01-11 at 17.45.14.png

  • Else
  • Add a Branch rule / related issues inside the ELSE block:
    • Type of related Issues: Epic (parent)
  • THEN (to place inside the branch rule)
    • Choose field to set: Story Points
    • Value:
      {{#=}}{{issue.Story Points}} + {{fieldChange.toString}} - {{fieldChange.fromString}}{{/}}

 

Capture 2022-01-11 at 17.55.34.png

 

Capture 2022-01-11 at 17.44.24.png

0 votes
Andreas Safar July 23, 2021

I was trying different proposals but it does set the sum value of story points to the epic. 

See my logic here

image.png

and here

image.png

so when the rule is enabled and I set or change story points in a story I'm getting no error

image.png

but when I reload the epic and check for the story points field, it remains empty

image.png

 

Did I misunderstood something, do you see an error in my logic or do you have a proposal on how to proceed?

Thx

0 votes
Wyner_ Zachary G_ July 10, 2021

@Gareth Cantrell 

Thank you for the workaround for summing story points into the Epic story points field! I am using JIRA server so I've been looking for a solution to this issue.

My rule runs without errors but the story point field in the Epic that should be updated is not being updated. Furthermore, if the Epic has a story point value it is erased when this rule runs.

Here is a screenshot of the rule. Any ideas?

Automation.PNG

Gareth Cantrell
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.
July 10, 2021

@Wyner_ Zachary G_ I'd suggest adding a Log action after the Send web request action and the log the value of your custom field from the web response to make sure the values you are getting back are what you are expecting to see.

Wyner_ Zachary G_ July 10, 2021

@Gareth Cantrell  Thanks for the fast response! I added a log action but it seems like the value being returned by the web request is the story point value for the epic, which is null.

Automation2.PNG

Gareth Cantrell
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.
July 11, 2021

@Wyner_ Zachary G_ as you say, you're logging the field in the epic. Try logging the response from the web request instead: {{webhookResponse.body.issues.fields.customfield_10002}}

Wyner_ Zachary G_ July 11, 2021

@Gareth Cantrell 

Getting closer! According to the log, the web request is retrieving the values I am expecting and the rule successfully executes. However, it still nulls out any value in the Epic "story points" field rather than summing the story point values from each story.

Automation3.PNG

Wyner_ Zachary G_ July 14, 2021

@Gareth Cantrell 

Just letting you know I got the rule to work! I had to change the formula in the edit issue fields action to this:

{{webhookResponse.body.issues.fields.customfield_10002.join("+")}}

Thanks for your help!

-Zac

Like Gareth Cantrell likes this
Gareth Cantrell
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.
July 15, 2021

Great to hear you managed to get it working, although I am surprised the sum() function didn't work for you.

May be worth raising a support request with Atlassian to investigate.

Cheers,

Gareth

Mohini Chandwani July 28, 2021

Hi @Wyner_ Zachary G_,

I guess the problem is in the web request URL, it is returning null because you didn't mention customfield of Story point to retrieve the story point value from those issues.

Can you just try these once -  {{baseUrl}}/rest/agile/1.0/epic/{{issue.key}}/issue?customfield_10002 it will return the story point values of all child of their Epic parent.

sum function should work, I am using the same approach it adds all the child story points and total will be added to respective epic parent.

refer the below snap.

story point.png

Hope it should work.

0 votes
Rahul_RVS_Support
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
April 6, 2021

Hi

You can try out our add-on to track progress of issues in Epic hierarchy on time estimates and at story points as well.

Agile Tools - Epic Tree and Time in Status 

The add-on allows you to manage and visualize your Epics with rolled up estimate progress reports along with multiple Time in Status Reports ( more than 6 reports).

Key features:

  • Epic Hierarchy
    • Epic Sum up - Roll up for Time estimates and Story Points
    • Excel like editing for key fields
    • Excel export of hierarchy dataProgress % on "remaining estimate" or "original estimates"
    • Include all issue types vs only Stories in Story Points roll up
    • Support for custom names for Epic & Story fields

     

  • Multiple Time in Status reports
    • Report Types
      • Time in Status
      • Time with Assignee
      • Time in Status with Assignee
      • Time with Assignee per Status
      • Status/Assignee Count
      • Multiple Transition Reports

       

    • Configurable working hours/days
    • Excel export

     

  • Transitions tracking on issue screen
    • Status/ Assignee Transition : Status/Assignee changes with average time and count per status. Option to switch between Graphical and tabular view.
    • Epic Tree on Issue Screen

 

Epic Hierarchy Screen_Server_Latest.PNG

 

TISwA-5-Apr.PNG

0 votes
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 10, 2021

Maybe consider the Epic Sum Up addon. There is a lite (free version) - epic-sum-up-light 

Andreas Haaken _APTIS_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
February 8, 2022

Hi Jack, 

 

thank you for recommending Epic Sum Up. The free Version sums up Time only, but the full version sums up everything you want.

Looks like this:

screenshot-jira.aptis.info-2022.02.08-16_52_44.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events