Does anybody know how to get the Story Points Committed and Completed in a Sprint from the JIRA REST API - the same as is shown in the Velocity charts
Hi @Ian Rees
I believe the velocity report gets the data, just-in-time, for the issues assigned to the sprint and rolls up the data. Which is why history is subjective on some JIRA scrum reports because users can alter the values of sprint, story points, etc. and the changes are only reflected on the sprint report, not things like the velocity chart.
To use the REST API to do the same you would get the issues when the sprint starts to roll-up the values, get the issues again when the sprint completes to compare/contrast.
Alternatively, you could use automation rules to do the same, and set entity properties in the sprint to capture the committed, completed, changed, etc.
Best regards,
Bill
Thanks Bill, I need to do this from the REST API. I can see a REST call to get the issues for a Sprint but this would mean getting the issues for a Sprint on the date it started and then the issues on the date it completed and I can't see a way of doing that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe you are correct: you would need information about the sprint externally from Jira to know when to make the REST API calls, and then perhaps schedule them.
Could you first use the REST API to get the sprint information, and then use that to set the scheduled calls for after start and after completed?
https://docs.atlassian.com/jira-software/REST/7.3.1/#agile/1.0/board/{boardId}/sprint-getAllSprints
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just added this answer to a similar question. Adding here in case someone else finds this question separately.
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> }
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI those old Greenhopper APIs are likely deprecated and unsupported. Please consider other solution approaches to avoid surprises.
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.
@Bill Sheboy , I'll keep an eye on our Jira version just in case the Greenhopper API gets dropped. The thing is, though, that I didn't randomly use it, I found that my Jira instance was pulling this API for its own velocity chart report. I looked through all the network resources in my browser console before finding and using this one.
I will also note that in order to use this API, I do have to pass an atlassian.xsrf.token cookie that appears to never change. I didn't realize that Postman was automatically receiving and passing this to my server. In any case, it works if you add that to the header of your request along with your normal auth token.
My use case is that I need to get a monthly report for multiple scrum boards covering a specific product ... so four sprints per month. I need the starting sprint points value (commitment) and the ending points value (completion) so that I can calculate a completion percentage. This is one of many automated reports I'm pulling using Jira APIs, GitLab APIs, etc.
While I can get the start and end dates from the normal Jira rest API, and I can use that to craft a JQL query to get all the work done in a sprint (being careful to set resolutiondate constraints), I couldn't see a way to get the sprint's starting point value.
I really do not want to have to manually enter start / end values for each sprint because that's error prone and basically creating a user interface where instead the data should be accessible. So, a report that used to take me several minutes to pull together by visiting a very slow velocity report for each of my teams, then manually entering data into excel, now takes upwards of 12 seconds and even less when I cache the JSON results from Jira.
Running this automatically, I was able to figure out that some of my previous reports were wrong due to human error (me). Anyway, I'll follow up with future changes if I run into them.
Here's what the end result report looks like after some quick development work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am having the same challenge. Does any one know if there have been any update on API to give this data?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.