Assign an Isuue to the latest sprint with REST API

I know how to assign an issue to a given sprint id, is it possible using REST API to assign to the latest sprint without specifying it in the post call ?

 

Thank you in advance

Ofer.

3 answers

Hi Ofer,

I believe you can do that. It should be something like:

It should be the following URL using PUT

http://localhost:8080/rest/greenhopper/1.0/sprint/rank


And your JSON should be something like:

{"idOrKeys":["TST-2"],"customFieldId":10009,"sprintId":4,"addToBacklog":false}


Where:
idOrKeys is the issue key
customFieldId is the ID of your Rank custom field
sprintId is the ID of the sprint
addToBacklog needs to be false since you are adding the issue to a sprint

To retrieve the Rank custom field ID please go to _Custom Fields_ page in Admin and view the custom field information. You will see the customfield ID in the URL.

I hope this helps.

Cheers,
Clarissa.

Hi Clarissa,

Thank you for your quick reply,

I do know how to assign to a sprint, my question was, how can i assign to the latest sprint, WITHOUT specifying which sprint it is.

Just using something like LatestSprint() 

Cheers,

Ofer.

Hi Ofer,

I'm afraid that's not possible, you will have to use the Sprint ID in the API call.

 Cheers,

Clarissa.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,323 views 14 20
Join discussion

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