Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,294,513
Community Members
 
Community Events
165
Community Groups

Get active sprint for an issue using REST API

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

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

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. 

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
Community showcase
Published in Jira Software

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

14,211 views 35 44
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you