Forums

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

How to get the current active sprint for a given project using the REST API?

Venkat Mavillapalli August 21, 2023

I'm currently using the POST method URL https://abc.atlassian.net/rest/api/2/issue to add an issue and sending the following JSON in the body. I'm successfully able to create the bug in the project where I have access.. But, I would like to add this bug into the active sprint. Don't know how and I have tried to check all the documentation but no avail.

 

{
    "fields": {
       "project":
       {
          "key""EMMM"
       },
       "summary""REST Test.",
       "description""Creating of an issue using project keys and issue type names using the REST API",
       "issuetype": {
          "name""Bug"
       }
   }
}

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
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.
August 21, 2023

Hi @Venkat Mavillapalli -- Welcome to the Atlassian Community!

I believe you would need to get all sprints for the board, and then identify the one with a state that is "active":

https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/#api-rest-agile-1-0-board-boardid-sprint-get

Once you have the sprint id, you can create the issue using the custom field id for sprint in your site to set the value.

Kind regards,
Bill

Venkat Mavillapalli August 22, 2023

Thanks for your help

Like Bill Sheboy likes this
Connor Stricklan
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!
December 30, 2024

This answer helped me, but you don't need to get all sprints, you can query for only the active one

.../rest/agile/1.0/board/{boardNumber}/sprint?state=active
Like Jignesh Shah likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events