Forums

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

REST API for issues under current sprint

Kent.A.Yeabower January 10, 2024

Is there a single REST API call I can make to get all issues under the active sprint? In our "issue" objects the sprint ID is given under customfield_10021 , however I can't use that in my JQL string. I'm also unable to use something like sprint in activeSprints() as "sprint" isn't a field on the issue objects.

Do I have to get all issues in the current Sprint by querying the Sprint url, instead of the issue url ?

1 answer

0 votes
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.
January 10, 2024

Hi @Kent.A.Yeabower 

I am a bit confused by your question; would you please add more details?

If you are calling the REST API functions, and know the project, an issue search with JQL would return them: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-get

If instead you already know the sprint, you could get the issues in the sprint with this one: https://developer.atlassian.com/cloud/jira/software/rest/api-group-sprint/#api-rest-agile-1-0-sprint-sprintid-issue-get

Kind regards,
Bill

Kent.A.Yeabower January 11, 2024

Hi @Bill Sheboy, so the main question above was, "Is there a single REST API call I can make to get all issues under the active sprint?" From your reply, it looks like the answer is "no" and that I will need to make at least 2 REST calls - (1) to get the active Sprint ID, and (2) to get all issues under that active Sprint ID. In the second part of my post I tried to elaborate on my issue but I didn't give much detail and think all I did was add confusion lol :D Thank you!

Like Bill Sheboy likes this
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.
January 11, 2024

If you know the project, only one call is needed: the first one I noted with a JQL search with 

project = yourProjectName AND sprint IN openSprints()

As described here: https://support.atlassian.com/jira-software-cloud/docs/jql-functions/#openSprints--

And if you have an example issue, you have the project as it is an attribute of the issue.

 

Backing up a bit: what problem are you trying to solve by doing this?  That is, "why do this?"  That context may help a bit.  Thanks!

Kent.A.Yeabower January 16, 2024

@Bill Sheboy ah ok gotcha, thank you! I was using activeSprints() instead of openSprints() , and wasn't getting any results, so using openSprints() fixed my issue. thank you!

And the "why" is I'm writing a small Python utility where I can get a list of a user's issues in the current active sprint, and allow them to create sub-tasks under those issues (for progress-report purposes).

Thanks again!

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events