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
Community Members
Community Events
Community Groups

JQL Function for issues in multiple sprints

I would like to look for all issues that have multiple sprint values. (regardless of the sprints are active or closed). 


It could be that there are tickets in completed sprints, but were spilled over from sprint 1 to sprint 2. but both sprint 1 and sprint 2 are closed. 


It would be optimal to achieve something like this: 

Project = ABC and sprint is not empty and sprint has 1 or more values. 


1 answer

0 votes

You can simplify the query you have there to just "Project = ABC and sprint is not empty" because not empty means "there are 1 or more values"

The important thing to know about the sprint field is that it contains a list of all the sprints an issue was in when it was ended.  It contains a sprint if you plan the issue into a future sprint, or bring it into the current active one (scope creep) as well, but if you remove an issue from a sprint before it is closed, the sprint is removed from the list.

Also, there are two ways an issue can have more than one sprint value.  The obvious one is "issue open, close sprint, so issue is added to the next sprint" but the other is "issue open, close sprint, issue goes back into backlog, and then goes into a later sprint (not just next, but next +1 or further).

So, yes, I think what you really want is a function that says "sprint field contains 2 or more values"

Rather than try to write that into a query (issuefunction is powerful, but can be slow and it's not obvious to most how to use it), I tend to cheat and use a scripted field.  If you set up a simple numeric scripted field, the  pseudocode is as simple as "return sprint.size()"

If you do that, you can then use a clause like "and number-of-sprints > 1" which is very obvious to people how to use!

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events