Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
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

Note

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.

Note

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.