How to sum the custom field value in all stories and display the total under the Epic

Sruthi Vijayakumar December 14, 2017

Hi,

I am using AUtomation for JIRA currently.

Is there a way where I can add the custom number field of all the stories under an Epic and display the total in an Epic custom  field?

 

Example:

Story 1 = 10

Story 2 = 15

Epic field should display 25

 

Thanks,

Sruthi

4 answers

1 vote
Don Kindred July 29, 2019

Is it possible to do this for something a simple as story points? It must be a common use case to auto-sum epics.

1 vote
Huw Evans
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.
December 14, 2017

Hey Sruthi,

I answered your question on our internal support tracker, but I'll re-post the answer I had here.

In your case, you want to update the story points of three fields. To do this, you'll need to create three separate rules, one for each field. Each rule should look like the following photos show (and you can click 'Copy' on the main screen once you've created the first one to make this a lot easier):

 

Screen Shot 2017-12-15 at 10.41.49 am.pngScreen Shot 2017-12-15 at 10.41.56 am.pngScreen Shot 2017-12-15 at 10.42.02 am.pngScreen Shot 2017-12-15 at 10.42.07 am.pngScreen Shot 2017-12-15 at 10.42.12 am.pngIt's important to have the check for whether the Epic exists, or you'll run into some errors when the field is updated on a rule without an Epic.

Then in the box under 'Edit issue', you want to have the following text:

{{issue.Sum me up}}{{^issue.Sum me up}}0{{/}} - {{fieldChange.fromString}}{{^fieldChange.fromString}}0{{/}} + {{fieldChange.toString}}{{^fieldChange.toString}}0{{/}}

You should change the words 'Sum me up' to the name of whatever field you're changing at the time.

I hope this helps you and anyone else visiting these forums!

Huw

Sruthi Vijayakumar December 15, 2017

Hi Huw,

The above solution worked for any newly created Epics and stories.

 

But does not work for already existing Epic with stories & points

Initial Set

Story 1 =5

Story 2 = 5

So Epic = 0

Now i edit one of the Story to trigger the rule

Story 1 =10 

Story 2 = 5

So Epic = 5

It is only taking the point from the story that triggered the rule. Not going over the rest of the stories to calculate their points

Everytime the Story number field gets updated, then the rule should go over the stories and calculate the sum.

 

 

Thanks,

Sruthi

Uthra Narasimhan October 1, 2018

Hi @Sruthi Vijayakumar@Huw Evans,

 

Could you pls let me know what the 3 triggers would be.

1. Trigger when Custom sum field changes

What would be the other two. Also will this work even when the storypoint is changed to 0.

Like Irène likes this
Pcseunix June 17, 2019

HI @Sruthi Vijayakumar

Did you resolve this issue, if yes can you share with us,
Even I'm stuck at a this point, where only the latest updates get updated.

Thanks in advance.

Regards,

Krishna 

Like Irène likes this
0 votes
Johnson Wang December 18, 2017

Hey @Sruthi Vijayakumar,

Looks like you're already using Automation. But if you're open to trying another add-on, I'd recommend using Power Scripts.

With a few lines of code you can very quickly sum the custom field values and display them in another field when viewing the Epic.

Here's a short video tutorial that walks through exactly how to setup this sort of algebra. You'd just need to modify the issue types, and change to addition instead of subtraction, for your needs.

And here's the sample code used, just for reference:

//This script grabs values from the expense field in the issues subtasks
//and then subtracts them from the budget
 
string [] stasks = subtasks(key);
int budget = customfield_10714;
 
if(isNotNull(budget)) {
    for(string s in stasks) {
        if(isNotNull(%s%.customfield_10713)) {
            budget = budget - s.customfield_10713;
        }
    }
}
 
return budget;

Hope this helps!

Thanks,

Johnson

0 votes
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 14, 2017

Hi Sruthi,

There are a couple Communities posts that have provided some guidance on this.  One suggestion I have seen is to use EazyBI and you can find a post regarding this add-on at EazyBI - calculate sum of custom field values for issues in Epic?

There is also another knowledge base article from Arsenal you may want to look at as well titled Rolling Up Epic Time Estimates.

Cheers,

Branden

Sruthi Vijayakumar December 14, 2017

Hi Branden,

 

Thank you for responding.

EazyBi is mostly for reporting.

 

I want the the numbers under 'Custom Field X' of all the stories to add up and display under the 'Custom Field X' in an Epic.

I see automation in JIRA add-on allows that. But not sure how to configure it for a custom field in JIRA.

Thanks,

Sruthi V

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events