Hi team,
I am looking for getting the last closed sprint in a JIRA Cloud instance project using Rest API.
any one help us on this.
Thanks
Naveen
Hi @Andy Heinzer I've got the same requirement for my Forge app when there are a large dataset of sprints in a specific board. The App won't work normally.
My App is called Sprint Reviewer to show all the sprint information in the Jira system: https://marketplace.atlassian.com/apps/1229698/sprint-reviewer?tab=overview&hosting=cloud
I've raised a ticket to Atlassian, but till now, haven't got the expected answer. Yeah, what I need is to extend the Rest API to support order by sprint id descending so that I can choose the latest 20 sprints for each board.
Hi,
I understand you are looking for the last sprint closed in a project in Jira Cloud via the REST API. There are a couple of problems that prevent this specific request. First off: sprints are not bound specifically to a single project. Sure you can set a sprint to only include issues from a single project, but the sprints have the ability to add any issues that could be included by the boards' filter. Hence any given sprint could span several projects. There is no clear way to only get back the last sprint that existed on a per project basis.
That said there is some information we could get from REST if we query the board itself, instead of the project. First you need to know the board's ID number. You can find this by visiting the board and looking at the URL for the rapidView number in the URL OR you can look it up by first looking up all the boards that use the saved filter's id number.
Once you know the board id number, you can get all the sprints on that board with the endpoint GET /rest/agile/1.0/board/{boardId}/sprint. There is not an endpoint to specifically retrieve the last sprint, so unfortunately, you would need to look at the state of each sprint on that board, and the endDate value and compare them against today's date/time. This is one way you can determine via REST API results which sprint was closed last on that board.
I hope this helps.
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atleast an "order by" support on GET /rest/agile/1.0/board/{boardId}/sprint would have been a great favour.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, there's still no this order by support currently.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The docs mention a "total" field but it does not seem to actually exist. If it did at least we could skip to the back of the results.
https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/#api-rest-agile-1-0-board-boardid-sprint-get
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
After some research it seems that there is no option for this out of the box.
The addon scriptrunner have a previous sprint function but only works in jira server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Mobamed, you're correct. This issue is still pending on Atlassian developers. They think it's not a high priority requirement.
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.