Function in JQL for current sprint?

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() ?

9 answers

1 accepted

You should use this : sprint in openSprints ()

Seems to do what I need, thanks!

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

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

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'

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

+1, there needs to be currentSprint()

+1, we need this as well.

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

+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

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

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

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

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

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.

Yay, this worked for me! thanks!

Ignacio Pulgar Community Champion Nov 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.

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.

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

+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.

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

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.

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

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

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

 currentSprint() not working for me 


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

Thomas Schlegel Community Champion Aug 23, 2017

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

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. 

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, but if you have ScriptRunner @Jamie Echlin might have a suggestion or two.  

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.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,981 views 12 18
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot