Common JQL queries for sprints in Jira Cloud

A common feature in Jira are Software boards - Kanban and Scrum boards are widespread in agile development.
While a Kanban board is a more simple approach with Scrum people usually work in sprints.

What is a sprint?

During the period of a sprint a team implements and delivers a discrete and potentially shippable application increment. This could be for example a working milestone version.

For new users a fixed duration of two-weeks for each sprint is common. Two weeks are long enough to get something accomplished, but not too long so that a team is able to get regular feedback.

In Jira Software, sprints are showed on a boards. Issues are to sprints using filters. You also can search for issues in upcoming sprints using JQL.

How to query for issues in different states of a sprint

Today I am going to show you some useful JQL queries which you can use to query for issues. Those are often assigned to either a currently opened sprint, a completed sprint or a future sprint.
Additionally you learn how find issues in a specific project which are at the same time contained in a sprint.

Searching for issues is easy - you can navigate to "Filters" >> "Advanced issue search" from within your Jira instance.

intro.png


While it is the possible to click on "+ More" and to select "Sprint" using the "Switch to JQL" button, which is a perfect option for new users to learn, you also can write your own JQL query.

As soon as you have created a sprint you can search directly by the sprint's name.
Example:
Sprint = "My sprint 6"

perSprintID.png

It will show you all issues that are contained in the sprint listed in the query.
In the example above you can see one issue assigned to a sprint "My sprint 6".

Searching for issues in future sprints

After their creation sprints it takes some time until planning work is done - therefore they are usually not started right away. Rather this happens when the team is ready - so sprints are considered being a future sprint right after their creation.
As soon as first issues were assigned to a future sprint you can query for them:
sprint in futureSprints()

future.png

Of course you can adapt this query. For example you can narrow it down to a project of your interest like this:

Example:
project = DEV and sprint in futureSprints()

This query will show all issues in project "DEV" that are assigned to future sprints.

Searching for issues in open sprints

As soon as a sprint is started you will want to use a different query.
A quite similar JQL query to the previous one will show you issues in open sprints:
sprint in openSprints()

open.png

Hint: depending on the configuration of your Jira instance it is possible that the feature "Parallel Sprints" is enabled. Doing so more than one sprint can be started at the same time.
If this is the case the query will show issues assigned to any sprint that has been started.
It is also worth mentioning that this query does not show issues that are assigned to future sprints (there is a clear distinction between sprints that have been started compared to them which has not been started yet).

Searching for issues in closed sprints

After the defined period has passed it is likely a sprint will be closed. For historical searches and analysis you will likely be interested in a reporting of issues that are assigned to closed sprints.
The query is similar to the ones you are already familiar with. You can query for issues in closed sprints like the following:
sprint in closedSprints()

completed.png

Hint: issues can be part of several sprints - one example are issues that are 'rolling over' to the next sprint because they could not be finished in the previous sprint.
Therefore it can be perfectly possible that you are seeing an issue as a result of both queries "sprint in closedSprints()" and "sprint in openSprints()".

InDetail.png

From the issue view you will recognize that by looking at the "Sprint" field.
In the example above you see an open sprint listed, alongside with one completed sprint.

Searching for issues in a project which have a value for sprint set

You can also see which issues are contained in sprints at all. This is recorded in the issue's respective field called "Sprint".
The query is easy again:
project = "UHD" AND Sprint is not EMPTY

QueryforSprints.png

I hope this showed you how easy queries for sprints work in Jira Cloud.
In case you are interested in using Scrum for your team there is awesome documentation from Atlassian available from "Agile Coach":
https://www.atlassian.com/agile/scrum
Agile Coach is a useful guide for learning more about Agile methodologies, no matter if you have just started your journey or if you an experienced practitioner looking to just verify some detailed information.

 

24 comments

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 29, 2021

Great article @Daniel Ebers . Thanks for taking the time to share with the Community.

Like # people like this
Mykenna Cepek
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 29, 2021

A great overview of ways to use the sprint-oriented JQL functions. Thanks @Daniel Ebers 

Bridget
Community Manager
Community Managers are Atlassian Team members who specifically run and moderate Atlassian communities. Feel free to say hello!
June 29, 2021

Amazing article!!!! Very well done @Daniel Ebers 

Karan Dhote
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!
July 23, 2021

Hey @Daniel Ebers Thanks for sharing this.

Although I tried this similar query  - "project = "UHD" AND Sprint is not EMPTY" but it didn't work for me. I am getting an error - "The operator 'is not' is not supported by the 'sprint' field." Any insights on why this would be happening?

 

Screenshot 2021-07-23 133949.png

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 23, 2021

That syntax is fine. I have to wonder if you have a custom field called Sprint.

Like Daniel Ebers likes this
Alquin Cook
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!
September 27, 2021

Hey @Daniel Ebers thanks for the great article! Is there a way to query just for a sprint? I have several teams that have active sprints, and I need to get the sprint names. 

Here's the JQL I have now:

project in (<myprojectName>) AND sprint in (openSprints()) AND Sprint is not EMPTY AND type not in (Sub-Task)

This returns all the issues for all the teams and I have to go through each issue looking for each team's sprint names. Ideally, I would like to have the JQL query return one issue per team, so that I can get the current sprint name. Is this possible? 

Daniel Ebers
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.
December 12, 2021

Hey @Alquin Cook

you can query for a specific sprint like Sprint = "MySprintName".
However, I am unsure for the last part of your question. Assuming there are several issues in a sprint Jira would return all of them so you can view them in detail.
In case the restriction to just one issue is a absolute requirement you could extend the query by a label, the single issue of interest would be needed to be labeled then (probably best with the team's name).

Regards,
Daniel

perza
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 1, 2022

I wonder whether it is possible to get sprint information with search? I would like to search a sprint by name, then check its active period dates.

Philippa Ford February 14, 2022

Hi how can I exclude sprints that are named "to be groomed"?

Mykenna Cepek
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.
February 14, 2022

The Atlassian Community is a great place for some of these questions.

@Philippa Ford: when searching for issues with JQL, sprint names aren't available for fine-grained searching. So you cannot say something like:

AND sprint !~ "grooming"

In JQL sprints are identified by their internal ID (a number). You can see this when you're typing JQL in a condition checking the Sprint field. Your best bet would be to either enumerate all the Sprints you want, with something like this:

AND sprint in ("sprint1", "sprint2", "sprint3")

or you can explicitly exclude sprints:

AND sprint not in ("grooming1", "grooming2", "grooming3")

@perza: The results of an Issue search can include whatever columns you want. Use the "Columns" menu to add the Sprint field and any date fields in issues of interest. The Sprint start and Sprint end dates are not available in a JQL issue search. 

Like Philippa Ford likes this
perza
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

@Mykenna Cepek : I realized that the issue data that I receive (via JIRA REST API) already includes the sprint data I need. It is in a custom field. It was hidden by the massive amount of data received :) 

I assume, that I can not make a query that would return a set of sprints?

Mykenna Cepek
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.
February 15, 2022

@perza - Your question (and the discussion that it warrants) really belongs as its own question (rather than in the comments to this article).

Please post your question as a new question here (click on "Ask the community > Ask a question" in the top-right).

Ideally, include the specific fields you are looking for (and apparently found in the REST API), and be as clear as you can about what you're trying to do. For example, are you looking for a JQL query or an API query?

Niall Poole
Contributor
March 8, 2022

@Mykenna Cepek Is it possible to find sprints that appear on a particular rapid board? (or using the filter query that drives the board?).

We have many agile teams working on the same project but I'm only interested in my sprints...

(My goal is a query that shows JIRAs which are assigned to one of my sprints but haven't been put in an Epic - the rapid board query looks for JIRAs in (Epics assigned to my team) - so JIRAs with a sprint and no Epic get 'lost'. At the moment I have to update the query every time I start a new sprint with the ID of the new sprint and was hoping for a better way...)

Niall.

Mykenna Cepek
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 10, 2022

@perza @Niall Poole @Philippa Ford - Welcome to the Atlassian Community! Happy to help you learn your way around the resources available to you here.

Please ask questions like these using the "Ask the community" link at the top of this page. That way you can get answers from lots of folks (not just me).

Consider also searching the community FIRST to see if your question has already been answered! That can be the quickest way to both learn and resolve your query.

This comment section is intended to discuss the article that @Daniel Ebers so thoughtfully shared.

(Apologies for setting a bad example by answering questions in this thread)

StnVikas Dhanorkar July 19, 2022

Is it possible to check Sprint is started and sprint is completed/closed? if yes please share JQL query.

sourabh
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!
September 12, 2022

Can anyone help me to answer how to find zero worklogs Stories for the active sprint?

Mykenna Cepek
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.
September 29, 2022

I'll try this again, a little more forcefully.

DO NOT ASK QUESTIONS HERE.

Please ask your questions using the "Ask the community" link at the top of this page.

This comment section is intended to discuss the article that @Daniel Ebers so thoughtfully shared.

Stephanie M. Davis March 14, 2023

This is an excellent article @Daniel Ebers . Thanks for taking the time to write it; it's already helped me.

Marcin Jankielewicz November 29, 2023

moved to 'Ask the Community'

Like Mykenna Cepek likes this
Peter Jones
Contributor
December 5, 2023

I love the "DO NOT ASK QUESTIONS HERE." comment. Such a nice place to be :(

Mykenna Cepek
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.
December 28, 2023

@Peter Jones - Questions about the article would be fine. But if you would have bothered to scroll up, you'd see that people were explicitly asking ME about questions not strictly related to the article (and it's not even my article). This is the COMMENT section. There is "Questions" place in this huge Community area, and it's best for people to go there for their ad-hoc questions. When people bury their rando queries in comment sections like this, they are extremely unlikely to get responses, and might mistakenly assume this community isn't responsive. Training newbies on how to participate appropriately in a community is a community effort.

JM Perrot
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 5, 2024

I've just discovered it, excellent article, good summary and explanations. Thanks for writing it.

Maximiliano Rojas
Contributor
May 24, 2024

Good day, I wanted to know if there is any way or filter to retrieve the sprints with their monthly hours without these accumulating with old sprints. Thanks!

Stephen Bull
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!
November 18, 2024

anyone solved the issue trying to isolate in a search the currently sprint when you have some rollovers from previous sprints and future sprints are already part populated?

This query does not return all items as the first term excluded rollover items:

"sprint in closedSprints()" and "sprint in openSprints()".

I want this for a dashboard, so don't want to keep having to edit the underlying search every 2 weeks)

Any help appreciated.

 

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events