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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,639,933
Community Members
 
Community Events
196
Community Groups

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
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.
Sep 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.
Mar 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.
Sep 26, 2016 • edited Feb 07, 2018

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

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