Sum up story points for issues in an Epic

Problem

You want to have a fields that contains the sum of all the story points under an Epic.

Solution

integer sum = 0; if(issueType == "Epic") { for(string i in selectIssues("parent = " + key)) { if(i.storyPoints > 0) { sum += i.storyPoints; } } } return sum;

Example output: 7

 

Make sure that the “Parent update” trigger is enabled in the scripted field configuration to ensure that the scripted field on the Epic gets updated when a Story (or other child issue type) is updated.

Also, make sure that the issue types of the child issues is added to the configuration so that scripted fields will be triggered when those children are updated.