Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA REST API how to move issue to sprint?

sam July 26, 2019

I just want to create issue under the sprint but create issue api dosen't provide sprint id to add issue in sprint 

to add issue in sprint here is other api to do is below

https://developer.atlassian.com/cloud/jira/software/rest/#api-rest-agile-1-0-sprint-sprintId-issue-post

 

any solution to direct add into sprint while creating issue via rest api? or how to move into sprint with javascript? and when i call above API it's giving 415 error with blank response.

1 answer

1 accepted

0 votes
Answer accepted
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 26, 2019

Hello,

You can always make two subsequent calls. The first one to create an issue and then move this issue to a sprint.

If you want to make it in one call, then set the Sprint field, when you create the issue.

sam July 26, 2019

Hi thank you for your response,

can you please provide the field example how it should be you can also check my code

fields : {
project : {
key : formData.get('project')
},
summary : formData.get('taskName'),
description: {
"type": "doc",
"version": 1,
"content": [{
"type": "paragraph",
"content": [{
"text": formData.get('taskDescription'),
"type": "text"
}]
}]
},
issuetype : {
id : formData.get('j-selected-issue-type-text')
},
assignee: {
id: formData.get('assign')
}
}

sam July 26, 2019

When I set sprint field it's throw error

sprint"Field 'sprint' cannot be set. It is not on the appropriate screen, or unknown."

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 27, 2019

You should add the Sprint field to the Create issue screen.

Maurice Straube
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 11, 2020

@Alexey Matveev 

I encounter the same issue, although i have added the sprint field to my create issue screen. Post creation for issues without relation to a sprint works. 

image (1).png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events