Forums

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

Get sum of all sub-task points

Peter Ellis
Contributor
November 18, 2022

We are using Story points on Sub-tasks. I have been trying to sum up all the story points on sub-tasks to their corresponding Story parent in a Scriptrunner scripted field. It's probably something really simple. I am not picking up the story points, it is only returning 0,

import com.atlassian.jira.issue.Issue

def subTasks = issue.getSubTaskObjects()
def intStoryPoints = 0

subTasks.each {

if(getCustomFieldValue("Story Points") != null)
intStoryPoints += getCustomFieldValue("Story Points")

}
return intStoryPoints

1 answer

1 accepted

1 vote
Answer accepted
Marta Woźniak-Semeniuk
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.
November 18, 2022

Hi Peter,

there was a someone who posted whole Script for Scriptrunner to do it in here https://community.atlassian.com/t5/Jira-questions/Using-Scriptrunner-to-sum-sub-tasks-story-points-to-parent-issue/qaq-p/1582757

 

There is also an example for sum-up of story points on adaptivist docs https://docs.adaptavist.com/sr4jc/latest/features/script-listeners/script-listener-examples

Peter Ellis
Contributor
November 18, 2022

Many thanks Marta :-)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events