Get number of committed and achieved points in a sprint

krishna patamsetti December 20, 2021

I am trying to use JIRA API to get a few things.

1. Number of points committed in a sprint

2. Number of points achieved in a sprint.

I think for 2), it is fairly straightforward, and we're using sprint name to extract the issues in that sprint and calculating the sum of story points that are closed. But there is a problem with this approach. When we try to search for issues in a sprint - let's say Sprint 2, the API searches across Sprint 2, Sprint 20, 21... 24. Looks like the API is not taking the "=" into account. Here is a sample query - 

curl --globoff --request "POST" --header "Content-Type: application/json" --data "{
  "expand":
  [
    "names",
    "schema",
    "operations"
  ],
  "jql": "cf[12600]=\"core-eng\" AND cf[10100]=\"2021 Sprint 2\" AND labels=\"performance\"",
  "fields": [
    "summary",
    "status",
    "assignee",
    "customfield_10100",
    "customfield_12600",
    "customfield_11904",
    "customfield_10002",
    "labels"
  ]
}" --url "https://our.company.jira.com/rest/api/2/search"

This issue has been replicated by using the issue navigator as well. If we use the Sprint Id then we get the correct results. But, getting a Sprint ID is not so straightforward. because it only retrieves the first 50 sprint-ids. Is there an easy way to get the Sprint-Id by using the Sprint name? 

And for 1.) I've tried searching for a lot of JIRA APIs but looks like there is no API that provides the committed stories of a Sprint based on the sprint name or Id. Please let me know if there is any such API that I can use to get the committed points/stories during the start of the sprint.

1 answer

0 votes
Bill Sheboy
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.
December 29, 2021

Hi @krishna patamsetti -- Welcome to the Atlassian Community!

I believe this one still works to get all sprints for a specific project:

myCompanyJiraUrl/rest/greenhopper/latest/integration/teamcalendars/sprint/list?jql=project=myProjectKey

And this one returns the sprint report for a specific board and sprint:

myCompanyJiraUrl/rest/greenhopper/1.0/rapid/charts/sprintreport?rapidViewId=myBoardId&sprintId=mySprintId

Please note: I believe the Greenhopper APIs are for internal use and have been deprecated.  Here are the current ones, so you may need to evolve your solution to use them and programmatically handle the searching issue you note: https://developer.atlassian.com/cloud/jira/software/rest/intro/

Kind regards,
Bill

Umesh Joshi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 16, 2024

Thanks this is great

Suggest an answer

Log in or Sign up to answer