You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
In the jira rest API doc for getting all sprints the api given is GET /rest/agile/1.0/board/{boardId}/sprint and the response is given as,
{ "maxResults": 2, "startAt": 1, "total": 5, "isLast": false, "values": [ { "id": 37, "self": "http://www.example.com/jira/rest/agile/1.0/sprint/23", "state": "closed", "name": "sprint 1", "startDate": "2015-04-11T15:22:00.000+10:00", "endDate": "2015-04-20T01:22:00.000+10:00", "completeDate": "2015-04-20T11:04:00.000+10:00", "originBoardId": 5 }, { "id": 72, "self": "http://www.example.com/jira/rest/agile/1.0/sprint/73", "state": "future", "name": "sprint 2" } ] }
here the field 'total' is in the api response but when calling the api all the other fields except "total' is coming...
how to get the total count of sprints in a board?
Sprints are specific to boards, not projects.
If you wanted to know the total sprints for a project, you'd have to get a list of all the boards first, then iterate through querying each board to get the number of sprints in that board, then total them all up.
Sorry let me correct one thing first, I am looking to find out a way to get the total sprints in a board.
Say there is a board and it consists of 90 sprints and when I run the API, the response will consists of maximum 50 results. I'm wondering how to get the remaining 40 sprints in that board without having the total value in the API response.
If there is total value then I could use maxResults=total value
Also I've tried GET /rest/agile/1.0/board/{boardId}/sprint? maxResults=x where x is a static value. But whenever I tried to give x value higher than 50 it won't show the maximum value(maxResults) as x in the API response instead it shows 50.
So how could I get the total sprints in a board?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For various objects, the REST API restricts the number of results returned to help manage processing load. When this happens, you need to do your searches in batches of that number; in this case it's batches of 50.
You use the startAt parameter to set the index point of where to start each search. You start at 0 then increment it by 50 each time until all the results have been returned or the value isLast is returned as true.
Refer to the Expansion, pagination, and Ordering section of the REST API documentation to understand how to use startAt, maxResults, total and isLast together in your queries to get all the sprints from a board.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"Refer to the Expansion, pagination, and Ordering section of the REST API documentation to understand how to use startAt, maxResults, total and isLast together in your queries to get all the sprints from a board."
The point is there is no total returned by the API when working out the total number of sprints personally I don't want to iterate my way through an endless loop calling the next 50 and the next 50 and the next 50 which pretty much negates the 'saving resource' argument as multiple calls are way more expensive, I'd prefer to know that I have 1000 sprints and then I'd like to return the last 50 iterate round untill I get to the sprints I want, WHY ! does the total not get returned as per the documentation is the question ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have documented this at https://jira.atlassian.com/browse/JSWCLOUD-23039. Please feel free to add other endpoints you find with the same behavior (the total value missing).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JSWCLOUD-23039 has just been closed as resolved! The sprint total is now returned in the REST API response :)
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.