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

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

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

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?

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 Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

247 views 0 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot