Function in JQL for current sprint?

Doug Varn
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.
August 9, 2013

If I had a filter that always dealt with the latest sprint, is there a way to eliminate my hard-coding the current sprint name?

Ex: Project = WA and Sprint = currentSprint() ?

14 answers

1 accepted

125 votes
Answer accepted
codelab expert
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.
August 9, 2013
You should use this : sprint in openSprints ()
Doug Varn
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.
August 10, 2013

Seems to do what I need, thanks!

Like # people like this
Chad A November 17, 2014

I believe this includes active and future sprints. Can you exclude future sprints?

Like Abrar Ali likes this
laurence February 25, 2015

confirming it does include future sprints, i would love to know how to exclude them

Like # people like this
laurence February 25, 2015

i tried "and sprint not in futureSprints()" but that doesn't work to exclude future sprints, looks like the function doesn't work properly unless i am missing something, or the definition of 'future sprint' is not what you and i think of what is future (i.e. everything that is neither current nor closed'

David Rouse June 1, 2015

+1, this needs to be fixed. How about a function currentSprint() instead of open sprints.

Like # people like this
SysAdmin June 10, 2015

+1, there needs to be currentSprint()

Like # people like this
Paul Stallworth
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 24, 2015

+1 for currentSprint() of some kind, just got this request from our web team today

Like Sean Riley likes this
Kyle Ford August 27, 2015

+1 for currentSprint(), though I'm not sure how that would work exactly since there can be multiple currently open sprints, so perhaps instead newestOpenSprint() and oldestOpenSprint() if the sprint start time is tracked

Like Naoual BENTAHAR likes this
raphilevine January 13, 2016

+1 for CurrentSprint() Would also to add CurrentActiveSprints() which should work on the Active Sprints Scrum Board and utilize the sprints which are selected

Adam Tiner March 1, 2016

+1, this would also resolve my issue of finding items that are not in the currentSprint()

https://answers.atlassian.com/questions/37031593

Rita Casaverde (DO NOT USE) May 6, 2016

 You can use "AND sprint in openSprints() and sprint not in futureSprints()"

Like # people like this
Richard Stimson March 9, 2018

+1 for currentSprint() or activeSprints(), openSprints() is not intuitive and doesn't match  the terminology used elsewhere in Jira. 

Bart van Houdt June 15, 2018

If you have only sprint per project the query below is nice:

sprint in openSprints()

 

But I have a project with multiple active sprints, how can I differentiate between those?

My goal is to create a filter that shows per sprint, the stories that we added after the sprint started.

What would be nice is something like:

sprint in openSprints('added stories') to show feature creep

maybe even:

sprint in openSprints('removed stories') 

Like # people like this
30 votes
chad_lavimoniere July 23, 2015

Just realized you can use "sprint in openSprints() and sprint not in futureSprints()" to get only the current sprint

Chad A August 27, 2015

Yes. 'sprint in openSprints()' shows only active sprints. I'm not sure if the behavior changed, but this is very handy. This and the futureSprints() function cover most of my use cases.

Like Anders Dyhrberg likes this
Rita Casaverde (DO NOT USE) May 6, 2016

Yay, this worked for me! thanks!

Ignacio Pulgar
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.
November 20, 2016

"sprint in openSprints()" never returns any issues returned by "sprint in futureSprints()".

So, your suggested JQL can be simplified to "sprint in openSprints()", as indicated by the accepted answer.

Like Anders Dyhrberg likes this
Anwesha Sarkar January 8, 2021

So happy :) this worked for me! Thanks!

Rameshwar Juptimath March 18, 2021

+1 for currentSprint() or activeSprints()

Like Bob likes this
DKrishnan March 24, 2021

+1 for currentSprint()

8 votes
Joey Gibbs April 29, 2016

I want a data field that indicates an issue's current sprint association. Right now the "sprint" field contains every sprint an issue has ever been associated with. This makes sense for long term reporting but it makes it difficult to see which sprint an issue is in right now. The currentSprint() and openSprint() don't provide that information.

gyoung_swingtech January 14, 2017

Completely agree, Joey, that this would be useful. Ideally, the team finishes all stories in one sprint, but that doesn't always happen.

Like # people like this
Eddie November 8, 2017

+1, this would be really useful for us. A distinction between sprint history and current sprint is really important, currently it's all rolled into one.

Like # people like this
7 votes
Ryan Beymer April 4, 2016

project = REPLACE_WITH_YOUR_PROJECT_ID AND sprint in openSprints() AND status in (Open, "In Progress") ORDER BY priority DESC, updated DESC

6 votes
Anders Dyhrberg May 1, 2019

There seems to be a bit of confusion on the functionality of openSprint()

I think it's because the name suggests that it returns all sprints that are not closed whis includes future sprints. I was also confused by this.

This is NOT the case. From openSprint() documentation it clearly states: "Search for issues that are assigned to a sprint that was started, but has not yet been completed"

So in order to find tasks in the active sprint you only need to write "sprint in openSprints()" no need to exclude future sprints.

Remember: There can be many active sprints. Typically one per Scrum team. Hence you still need to include only the tasks that relates to your team.

4 votes
Mike Fisher January 5, 2018

If you have multiple open Sprints in your Backlog for forecasting and you want to view only your active Sprint, this JQL works:

project = MIG AND Sprint in openSprints() AND sprint not in futureSprints() ORDER BY status DESC, issuetype

3 votes
Carissa Wikstrom Buchanan June 20, 2019

I used Sprint in openSprints() AND Sprint not in futureSprints()

2 votes
Tony gifford November 6, 2019

for the current sprint use:

and sprint in(openSprints()) and sprint not in(futureSprints())

1 vote
Shiang Fu June 26, 2020

You can add one unique label, and combine the filter. eg. as below:

project = IHD AND labels = "Digitalabc" and Sprint in openSprints() ORDER BY Rank ASC

1 vote
Leonard Collins July 3, 2019

This is useful info for me. Thank you.

Carissa Wikstrom Buchanan July 3, 2019

Please upvote useful comments, so others will see them. :)

Like knedlik likes this
1 vote
Jens Helmstedt June 15, 2016

What about open sprints of current project or of a specific project (like openSprints(current project) )?

1 vote
STANISLAV PRIKHODKO May 18, 2016

I need to see last 4 sprints. The function currentSprint() would help here if it existed. I don't see how openSprints() can help here, so the original question seems to be still relevant.

Paul Stallworth
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 18, 2016

You can use closedSprints() to get at issues in past sprints.  Not sure about limiting it to the last 4 though, maybe using updatedDate would get you close.  Something like:

Sprint in closedSprints() AND updatedDate >= -8w
0 votes
RJ Greenhalge October 31, 2017

I keep getting the error 'An option provided by the function 'openSprints' for the field 'sprint' does not exist.'

We definitely have an active sprint with issues in it.

Richard Stimson March 9, 2018

Are you using 'sprint in openSprints()' in the JQL search?

0 votes
Mayank Kapoor August 23, 2017

 currentSprint() not working for me 

 

Error : Unable to find JQL function 'currentSprint()'.

Thomas Schlegel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 23, 2017

a function called currentSprint() does not exist. OpenSprints() is what you are looking for.

Mayank Kapoor October 23, 2017

yes

Mike Fisher December 22, 2017

An open Sprint is any Sprint that is not in a close status.  We have several open Sprints because we are Product Roadmapping.  I need a search function that only returns the current "Active" sprint that has been "started" and that we are current working in. Open Sprints returns too many issues. 

Paul Stallworth
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 5, 2018

Starting with the 7.2 Jira Agile REST API, you can set properties on sprints.  Depending on what resources you have available to you, you could set an "active" property on the desired sprint and update as needed.

Not sure if you can use that in JQL yet like you can issue.property, but if you have ScriptRunner @Jamie Echlin might have a suggestion or two.  

Suggest an answer

Log in or Sign up to answer