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

This widget could not be displayed.

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 Sign up to answer
Community showcase
Published Apr 22, 2018 in Jira Software

How-to setup a secured Jira Software 7.9.0 on Ubuntu 16.04.4 in less than 30 minutes

...PermissionsStartOnly=true User=www-data Group=www-data ExecStart=/opt/jira/bin/startup.sh ExecStop=/opt/jira/bin/shutdown.sh TimeoutStartSec=120 TimeoutStopSec=600 PrivateTmp=true [Install] WantedBy...

1,436 views 10 12
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