How to get current sprint in board with REST API?

Seikyo Cho April 13, 2024

I have a Backlog as

1.png

The sprint 1 and sprint 2 are created by Create sprint API:

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

The AW Board Sprint 1 is the default area.

When I click Start sprint button in sprint 1, it been copied to Board menu as

2.png

But when I get sprint with API like:

  • https://my-domain.atlassian.net/rest/agile/1.0/sprint/1

It returned

{
"id": 1,
"self": "https://my-domain.atlassian.net/rest/agile/1.0/sprint/1",
"state": "future",
"name": "AW Board Sprint 1",
"createdDate": "2024-04-10T01:01:01.873Z",
"originBoardId": 1,
"goal": ""
}

These APIs returned error:

  • https://my-domain.atlassian.net/rest/agile/1.0/sprint/2
  • https://my-domain.atlassian.net/rest/agile/1.0/sprint/3
{
"errorMessages": [
"We could not find the sprint"
],
"errors": {}
}

Why can't get the created 2 sprints by API? And which API can be used to get the current ongoing sprint in Board?

2 answers

1 accepted

0 votes
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.
April 13, 2024

Hi @Seikyo Cho 

You may get the specific sprint by id, as @Kalyan Sattaluri notes, or you may get all of the sprints for the board, filtering to the one(s) with the active state using the parameter:

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

Kind regards,
Bill

Seikyo Cho April 14, 2024

Hi @Bill Sheboy 

Thank you. In this way I got all the sprints in board 1. From the state == active I can get the current ongoing sprint.

By the way, how to get all issues in one sprint?

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.
April 14, 2024
Seikyo Cho April 14, 2024

Thank you @Bill Sheboy .

It works for me!

Like Bill Sheboy likes this
1 vote
Kalyan Sattaluri
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.
April 13, 2024

Hello @Seikyo Cho 

Are you sure you are passing the right sprint ID in your request call?

Open story AW-3, on the right hand pane where it shows sprint, hover over it, what is the ID of the sprint you see in the bottom left of your screen? Same goes with AW-4 story. Cross check the sprint ID for the 2 other sprints.

 

Seikyo Cho April 14, 2024

Hello @Kalyan Sattaluri 

Thank you.

Do you mean this sprint item?

3.png

I hover over it but didn't find any information.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events