Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JQL for tickets closed within a time range

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

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.

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!

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")

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

Like # people like this

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

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
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you