Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

What is the script runner query to get a list of STORY POINTS IN A SPRINT

Hi All 

What is the script runner query to get a list of STORY POINTS for a given set of SPRINT? (Like 3 to 5 sprints )


and also looking for a gadget 

most of the gadgets not supporting story points fields in gadgets.


can anyone help with this


Thank you




1 answer

1 accepted

1 vote
Answer accepted
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 10, 2023 • edited

Hi @vasanth

For your requirement, you can use the working script below:-

import com.adaptavist.hapi.jira.issues.Issues
import com.adaptavist.hapi.jira.projects.Projects
import com.atlassian.greenhopper.service.sprint.SprintManager
import com.onresolve.scriptrunner.runner.customisers.PluginModuleCompilationCustomiser

def project = Projects.getByKey('MOCK') // Change the Project Key

def sprintManager = PluginModuleCompilationCustomiser.getGreenHopperBean(SprintManager)
def sprintName = sprintManager.getSprint(2) // Change the Sprint ID"project = ${project.key} and Sprint ='${sprintName}'").collect {
it.getCustomFieldValue('Story Points')

Please note that the sample working code above is not 100% exact to your environment. Hence, you will need to make the required modifications.

Also, for this code to work, please ensure you upgrade your ScriptRunner plugin to version 8.2.1 to use the HAPI feature.

Below is a screenshot of the code in the ScriptRunner console. 


To get the sprint id, you can click on the issue navigator icon as shown in the screenshot below:-


Once that icon is clicked, you will be redirected to the JQL Query page, as shown below.


In the JQL query field, the Sprint id will be displayed.

Below are a couple of test screenshots for your reference:-

1. Below is the Sprint Board which displays the issues from which the Story Points will be extracted



2. For the Mock 3 issue, the total Story Points used is 12, as shown below:-


3. From the Mock 4 issue, the total Story Points used is 15, as shown below:-


4. From the Mock 5 issue, the total Story Points used is 12, as shown below:-


When the script is executed on the Script Console, it will sum up all the Story Points from all the issues currently in the Sprint. As shown below, the total points of all the 3 issues above totals 39 points.


I hope this helps to answer your question. :-)

Thank you and Kind regards,


@Ram Kumar Aravindakshan _Adaptavist_ 


thank you

I wil check this.


Thank you


Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events