Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×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.
Ok, I've been working my way through this same issue for some time now and reviewed numerous questions / answers on these boards. Here's what I found today while reviewing the console queries in Chrome when requesting the velocity chart for a specific board. I got to this answer from a comment on another question where this API was exposed, but the returned data was limited to the past 7 sprints. Instead, this one is limited to 120 sprints, which should be sufficient for most purposes.
The trick is to add a date range to the query and changing the "velocity" endpoint to "velocity.json".
When I ran the following API request through my Jira system in postman, I got back 18 sprints with sprint ids, start / end dates, commitment & completion points.
https:://<your-jira-domain.com>/rest/greenhopper/1.0/rapid/charts/velocity.json?rapidViewId=10986&sprintsFinishedBefore=2024-09-07T04%3A59%3A59.999Z&sprintsFinishedAfter=2023-12-25T05%3A00%3A00.000Z
Run this in postman with your auth token and you will get back JSON with Sprint details in an array of sprints, like this ...
{
"sprints": [
{
"id": 12345,
"sequence": 12345,
"rapidViewId": 54321,
"name": "This is an Example Sprint Name",
"state": "CLOSED",
"goal": "",
"autoStartStop": false,
"synced": false,
"startDate": "21/Aug/24 9:20 AM",
"endDate": "04/Sep/24 9:20 AM",
"activatedDate": "21/Aug/24 2:12 PM",
"completeDate": "04/Sep/24 1:07 PM",
"canUpdateSprint": true,
"canStartStopSprint": true,
"canUpdateDates": true,
"remoteLinks": [],
"daysRemaining": 0
},
{ <more sprints> }
],
"velocityStatEntries": {
"12345": {
"estimated": {
"value": 78.0,
"text": "78.0"
},
"completed": {
"value": 80.0,
"text": "80.0"
}
},
{ <more sprints> }
}
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks this is great
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.