Forums

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

REST API - GetSprints Returning ALL sprints

Paul Rambault
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!
February 15, 2022

Hello,

 

I have the same problem as mentionned in this topic (https://community.atlassian.com/t5/Jira-Software-questions/REST-API-For-GetSprints-Returning-ALL-sprints-not-just-from/qaq-p/1805627), it is marked as solved but it is clearly not.

When I do a curl to the API to get the sprint for my board I get all the sprints including ones from other boards. I can add anything in the JQL I have always the same amount of sprints in the exact same order.

I'm using this curl: curl -u xxxx:xxxx https://mydomain.atlassian.net/rest/agile/1.0/board/30/sprint?jql=sprint+in+openSprints%28%29&

It works fine to get all issues with: curl -u xxxx:xxxx https://mydomain.atlassian.net/rest/agile/1.0/board/30/issue?jql=sprint+in+openSprints%28%29&

Someone have solved this? How can I create a ticket to Jira to investigate in the API?

Thanks.

1 answer

0 votes
Sunny Ape
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.
March 1, 2022

Hello @Paul Rambault 

I use the Get all sprints endpoint all the time, and it only ever returns the sprints for the board I request. I've never seen that problem described in that other post.

For both Jira Cloud and Server, the Get all sprints endpoint does not accept JQL queries as a parameter, so adding all that "jql=sprint+in+openSprints()" stuff does nothing. The correct parameter to use is state, as per the REST API documentation:

state

object

Filters results to sprints in specified states. Valid values: future, active, closed. You can define multiple states separated by commas, e.g. state=active,closed

Also, your request ends with a question mark, but you have no parameters declared after it.

These two things might be part of the problem.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events