Forums

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

We are currently looking for an API to get a list of the sprints in a project (using the project id

Pratik Sominath Zinjurde
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!
June 12, 2023

Hello team!

We are currently looking for an API to get a list of the sprints in a project (using the project id or project keys) along with the sprint state (closed, active, future). We also need support to search for a sprint from a text query.

Based on our findings, we found the following solutions however they do not fit our requirements -

  1. The rest/api/3/jql/autocompletedata/suggestions API.
    1. This API accepts a search query, but it returns all the sprints across all the projects. Currently, there is no way to filter the sprint on a project level
    2. It also does not return the state of the sprint and ends up returning the closed and old sprints which we want to be able to exclude
  2. The rest/agile/1.0/board/{boardId}/sprint API which has the following issues
    1. We will need to first fetch all the board ids from a project and then get the sprints. This might require multiple API calls and hence slows down the overall functionality
    2. Additionally, this API doesn’t support searching for sprints which we would have to then implement on our end by fetching all the boards + sprints on every search query

Asks:

  1. Is there any other API that you are aware of for solving our requirements?
  2. If not, would it be possible to take one of the following actions -
    1. Add an API to get the list of sprints for a particular project along with the state of the sprint and functionality to be able to search the sprints
    2. Modify the rest/api/3/jql/autocompletedata/suggestions API to return the state of the sprint (closed, active, future) along with the displayName and key that is being returned currently

Thanks!

1 answer

1 vote
Evgenii
Community Champion
June 13, 2023

Hi, @Pratik Sominath Zinjurde 

In Jira, sprints are part of Board, not Project. Sprint can contain issues from different projects.

In order to get information about all the sprints connected to a board, you need to send a GET request to: 

/rest/agile/1.0/board/{boardId}/sprint 

This API call has parameter state, that can help to filter Sprints by their status

Full description is here:

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

More info about Sprints API can be found here:

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

Pratik Sominath Zinjurde
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!
June 13, 2023

Hello @Evgenii !

The problem with /rest/agile/1.0/board/{boardId}/sprint is with multiple API calls which we want to avoid.

Is there any way we can request JIRA team to add the sprint state to the rest/api/3/jql/autocompletedata/suggestions API ?


Evgenii
Community Champion
June 14, 2023

You can,t look for sprints with JQL, but you can search for issues in sprints.

JQL will look like:

project = TEST AND sprint IN openSprints()

Suggest an answer

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

Atlassian Community Events