JiraAgile API - When completing a Sprint, how to move open issues to next planned Sprint?

sheryl Pinto January 23, 2018

We complete our Sprints via a REST API call to PUT /rest/agile/1.0/sprint/{sprintId} 

This moves all the In Progress issues to the backlog. I'd like to move them to the next planned Sprint instead. When I complete a Sprint via the web UI, I see the dropdown box to select the next planned Sprint. But I don't see how to do this via API - https://developer.atlassian.com/cloud/jira/software/rest/#api-sprint-sprintId-put

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 23, 2018

Hi Sheryl,

I understand that you are looking to be able to make a single REST call when closing the issue that will allow you tell Jira Software (Agile) where to place those incomplete issues in the sprint.   As you noted this does not appear to be possible within the REST API at this time, but I agree that this seems like a reasonable request since when you are using the web gui for Jira, this is something that automatically now pops-up in the browser when closing the sprint.

So I created a pair of feature requests for this (one for Cloud and the other for Server)

While I do not have a specific time frame for if or when this might be added to Jira Software, I would recommend watching and voting on this issue so that if this should be added to the product that page will most likely be the first place to indicate what version of Jira this feature could be added to.

Regards

Andy

sheryl Pinto January 25, 2018

Thank you Andy!

Instead of a single REST call, are there other ways to achieve this programmatically? Can the "move issues" REST API call move issues to the next Planned Sprint, or does the target Sprint have to be Active?

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 25, 2018

When you close a sprint in the web interface, Jira Software only has the option to move the issues into the backlog, or into a future planned sprint.  As such I don't believe there is a way to close the sprint and have those issues automatically placed in an active sprint.

Also to put an issue into a sprint, you are not actually moving the issue.  The move function in Jira is used to describe changing what project an issue exists in.  Sorry to define terms here, but I just wanted to be clear about that part.

You might be able to still use REST calls to change what sprint an issue exists it though.  In Jira Software each issue in a software project has a Sprint field associated with it.  By default this field does not usually appear on any screens in Jira so when looking at the issue details or edit issue you typically won't see this field/value.  The value in this field determines which sprint an issue exists in.  So it is possible that you could use the edit issue endpoint https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue-editIssue

in order to update the issue and set that specific field to have a different value than it currently has.  That is one way you can use REST to set which sprint each issues exists in.  

Suggest an answer

Log in or Sign up to answer