Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner listener for storing sum of story & task story point estimates on epic

Teresa de Figueiredo
Contributor
February 18, 2019

Hi! I am trying to use  scriptrunner to sum the total story point estimates on stories & tasks in an Epic on the Epic. I have created a custom field "Sum of Story Points" for the epic, and have an existing custom field "Story Points" that is used on stories and tasks. 

I've been trying to use this scriptrunner example as a template, but am getting stuck: http://scriptrunner-docs.connect.adaptavist.com/jiracloud/script-listeners.html#_store_subtask_estimates_in_parent_issue_on_issue_events 

 

Thank you!!

Teresa 

5 answers

3 votes
Joe Baldwin
Contributor
January 28, 2021

Hi Teresa,

In addition to Kristian's reply, you can also use a Scripted Field with Jira Server or Data Center. Our Server/DC documentation has the information you will need to get started. 

If you need some ideas for how to write your script, please take a look at our Script Library which contains plenty of examples that you can use, or modify, to fit your business needs. 

Kind regards,

Joe

3 votes
Kristian Walker _Adaptavist_
Community Champion
January 28, 2021

Hi Teresa,

I can confirm if you are using ScriptRunner for Jira Cloud then you can achieve this requirement using a Scripted Field and I can confirm we have an example in the documentation page here that explains how to do this.

Using the steps on this page then you will be able to create a Scripted Field which when the issue is loaded calculates a sum of all the story points from all issues inside of the Epic issue.

I hope this helps.

Regards,

Kristian

0 votes
Deidre East
Contributor
January 23, 2025

Using ScriptRunner for Cloud, create a scripted field (https://docs.adaptavist.com/sr4jc/latest/features/scripted-fields#_sum_up_story_points_below_an_epic_issue_scripted_field) called "Total Story Points."

<your cloud site>/plugins/servlet/ac/com.onresolve.jira.groovy.groovyrunner/scripted-fields?s=com.onresolve.jira.groovy.groovyrunner__scripted-fields

For the code, use the following from the Example scripts button and search for "story points."

def currentIssue = Issues.getByKey(issue.key as String)
if (currentIssue.getIssueType().name == 'Epic') {
return Issues.search("parent='${currentIssue.key}'").collect { child ->
child.getCustomFieldValue('Story Points') ?: 0 // if Story Points is null default to zero
}.sum()
}

 Then, you can add Total Story Points to your Epic view screens.

0 votes
Shaili_RVS_Support
January 28, 2021

Hi 

As an alternative, you may want to try out our add-on to manage multiple Epics and their hierarchy on a single page.

Agile Tools - Epic Tree and Time in Status 

Manage and visualize your Epics with rolled up estimate progress reports.

Below are the key features:

  • Epic Sum
  • Configure progress % calculation on either "remaining estimate" or "original estimates"
  • Epic Tree directly on Issue Screen
  • Display and manage Epics/Issues of your project
  • Real time edit option for Issue summary, status, time estimates, story points and assignee on the tree on the Epic Hierarchy
  • Rolled up percentage completion and at issue level as well
  • JQL support for Epic Hierarchy screen
  • Time in Status report using JQL
  • Issue Tracker to view complete transitions on your issue screen
    • Status Transition : View all the status changes in a single tab along with average time and count in each status. Switch between graphical and tabular view to make more out of the data.
    • Assignee Transition : View all the assignees for the issue along with the time for which the issue was with each assignee. Switch between graphical and tabular view to make more out of the data.

 

Epic Hierarchy Screen_Cloud_Edit.png

Epic Hierarchy_Issue Screen_Cloud.PNG

0 votes
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 18, 2019

Hello Teresa,

Here are some script examples to try on Script-runner:

Scripted field to sum story points of issues linked to an epic in closed status

Scriptrunner scripted field: Need sum of story points only where resolution is fixed, done or empty

scripted field showing sum of story points left in epic

Additionally, have you tried the free add-on Epic Sum-up Light? I think this is a good and easy option to achieve your need.

Let me know if these options help.

Aleksey Lazaryev
January 27, 2021

Hi Petter,

 

Is Epic Sum-Up Light sufficient to roll-up all hours to an Epic? Do I need the paid version?

Suggest an answer

Log in or Sign up to answer