Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I construct a JQL query, to find the most recently completed sprint?

Mike_Hermann March 11, 2019

I have a custom query to compare estimated times against story points. The team already uses the custom query. Currently, we have to change the sprint number any time we want to use the query, to make it match the current (or planned) sprint, and we have to remember to do that.

I'd like to extend the custom query, so it can determine the current sprint number, automatically. 

I've looked around for a schema specification for JQL. If it's published somewhere, I can't find it.

Question 1: Using your JQL query language, How can I construct a query, that returns the current active sprint?

Question 2: if no sprint is active, how can I write a query for the most recently completed sprint?

 

2 answers

0 votes
Daniel Turczanski - JQL Search Extensions
Atlassian Partner
September 2, 2021

Hi @Mike_Hermann 

It's been a while but I think it may be helpful to people who are still looking for a cloud solution. You can consider using our professional indexing service

After you install the app you can find issues from a previous sprint:

issue in previousSprint("My board")

Make sure to check out the documentation.

I hope it helps!

0 votes
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 12, 2019

Hello Mike,

I hope you're having a wonderful Tuesday! :)

Can you please let us know if you are using JIRA Server or Cloud application?

Answering your questions:

Question 1: Using your JQL query language, How can I construct a query, that returns the current active sprint?

To return issues from your Active Sprints, you can use the following query:

Sprint in openSprints()

You can also combine this query with the project, issue type or any other parameter to get the information you are looking for:

project = test and Sprint in openSprints()

 

Question 2: if no sprint is active, how can I write a query for the most recently completed sprint?

Unfortunately, the JQL feature does not have a parameter to return the issues that were placed in the most recently completed Sprint, however, this functionality was already requested to our development team:

In a Filter, I should be able to query for issues closed in the most recently closed sprint

Feel free to vote and watch the suggestion to increase its priority and also receive notifications about any updates.

That been said, if you are using JIRA server, you can use the previousSprint parameter provided by Scriptrunner plugin to extend the JQL functionality to return this information.

Let me know if this information helps!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events