Get active sprint for an issue using REST API

Stephan Grubbe Sølby June 23, 2022

Hi all,

We're importing issues into own developed application. For each issue, we need to calculate the current active sprint for that issue. 

The sprint field is a list containing all sprints the particular issue was ever in. We need to identify the current sprint the issue pertains to.

This is not as easy as it sounds, since we can have more than one sprint open at the time, so if an issue is moved from one open sprint to another, how do I determine which is the correct active sprint? As we also handle historic data, restricting to openSprint alone will not work for closed issues (the sprint from which the issue is closed is the relevant one in this scenario.

We assume, we could check against the list of sprints to find which open sprint a particular issue-id belongs to, but that seems rather complex and time-consuming...

What we would prefer is just a simple attribute on the issue itself, active sprint or last active sprint? Or can we assume that it's always the last sprint in the sprints field? 

I hope the above gives sufficuent insight into what we are trying to accomplish.

I'm not the developer, so it's hard for me to share code or XML examples, but I can get that if need be.

1 answer

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.
June 23, 2022

Hi @Stephan Grubbe Sølby 

I believe you have summarized this use case well with your note "that seems rather complex and time-consuming"  :^)

If your team is moving an issue from one active sprint to another one, you may need to check the history to find the current/latest value.  Based upon my experience with automation rules (which also use the REST API) I do not believe you can rely on the order of values in the issue's sprint field, particularly if the sprints have the same start/end dates.

Question: You seem to describe using parallel sprints.  If those are for separate teams' boards, might the filters provide information you could use to partition the issues, such as a Component value by team?

Kind regards,
Bill

Stephan Grubbe Sølby June 23, 2022

Hi Bill,

Thanks for replying.

Its not exactly parallel sprints although we are running into our "scrum-but" process, where at times a team is working on two sprints because they are (mistakingly) considered as releases rather than time-boxes.

I any case, an issue is still only I'm one sprint at a time and we're interested in which one regardless of sprint status {future,open or closed).

I don't think I see any other way, but fetch entire list of sprints (for a project) and simply find each issue id and category and update data in the app accordingly. 

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.
June 23, 2022

Thanks for clarifying, and good luck!

Suggest an answer

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

Atlassian Community Events