JQL for tickets closed within a time range

Dora Skorcheva September 26, 2016

Hi,

I would like to see all bugs that are closed (with status 'Closed') for a specific time range.

So far I have come up with sth like, but this doesn't suit me.

project = "XYZ AND issuetype = bug AND status changed to closed AND updatedDate < "2015/08/01 00:00" AND updatedDate > "2016/09/15 00:00"

 

Thank you,

BR
Dora 

4 answers

2 accepted

10 votes
Answer accepted
Alex Christensen
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2016

In your current query, I think you have the date searching operators switched. I think you should be using this instead:

project = "XYZ AND issuetype = bug AND status changed to closed AND updatedDate > "2015/08/01 00:00" AND updatedDate < "2016/09/15 00:00"

Basically, you were trying to search for issues that have an updated date that is both before 1 August 2015 and after 15 September 2016, which is impossible to fulfill.

In your workflow, do you set a Resolution when closing the bug? Whenever you set a Resolution for issue, JIRA also sets a Resolution Date value. You can use this Resolution Date value in your JQL query. Based on your query about, it would look something like this:

project = XYZ AND issuetype = bug AND resolved >= 2015-08-01 AND resolved <= 2016-09-15

This is a much simpler query to use, in my opinion.

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 17, 2021

Hello Everyone,

Several teams have interacted In this thread for the past few years, so here is an updated answer for everyone interested in this matter:

Today we’ve two ways to return issues that were closed in a specific time range using the advanced search (JQL) in both Jira Cloud and Server:

  1. Using Dynamic date & time. In the example below, I’ll return all the issues changed to the ”Closed” status between five and two weeks before my current time:

    status changed to closed after -5w before -2w

  2. Using Static date & time. In the example below, I’ll return all the issues changed to the ”Closed” status between “08/01/2020 00:00” and “09/15/2020 00:00”:

    status changed to closed after "2020/08/01 00:00" before "2020/09/15 00:00”

You can check the documentation below for more details about the functions and operators used in the Advanced queries:

What is advanced searching in Jira Cloud?

Thanks!

13 votes
Błażej O_
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 26, 2016

Just try:

project = XYZ AND issuetype = bug AND status changed to closed BEFORE "2016/09/15" AFTER "2015/08/01 00:00"

or simply:

project = XYZ AND issuetype = bug AND status changed to closed DURING ("2015/08/01 00:00","2016/09/15")
Misael Rodriguez November 26, 2018

any way to have it run by the last 4 weeks? (without having to insert static dates)

Like # people like this
Błażej O_
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 27, 2018

Sure, just use interval notation, or some date functions.

Following query will show you all bugs that were closed between 5 weeks ago (-5w) and 1 week ago (-1w).

project = XYZ AND issuetype = bug AND status changed to closed BEFORE -1w AFTER -5w

You can also use date functions. Following query will always display bugs closed during last month:

project = XYZ AND issuetype = bug AND status changed to closed AFTER startOfMonth(-1) BEFORE startOfMonth() 

 

If you want to get issues changed in last 4 weeks just use an "AFTER" clause with -4w value.

Like # people like this
0 votes
James_McManamey July 25, 2019

We've written up a post on how you can find yesterday's completed issues in Jira.

https://stratejos.ai/blog/find-jira-issues-completed-yesterday-using-jql/

Also how you can filter the results by the people who completed them. Great for product managers and team leads. 

Stratejos lets you run JQL from Slack and also set up daily custom messages with the results of any JQL. 

Suggest an answer

Log in or Sign up to answer