JIRA 4.4 search/filter how to find issues resolved in last seven days?

Christopher Grantham March 15, 2012

Hi I've been playing around with jqlQueries trying to retrieve a list of issues for a given project where the status has changed to resolved in the past week. I need this to use in a jqlQuery for the jiraissues confluence macro.

I have tried things like the following advanced search syntax:

resolved > -7d

but have not had any luck.

Any help is much appreciated.

Thanks in advance

Chris.

11 answers

1 accepted

25 votes
Answer accepted
JamieA
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.
March 15, 2012

It's: resolutiondate >=-1w

Tip: You could run the "Recently Resolved" filter from any project, switch to advanced, and see the jql for this like that.

Christopher Grantham March 18, 2012

Thanks for that, it solved my problem. :)

JamieA
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.
March 18, 2012

Great, can you mark my answer as correct, by clicking the check mark ;-)

Mohammed Rashid January 26, 2014

You saved my day. Worked like a champ

SheikI January 11, 2015

thanks.. working fine.. :)

Jennifer Warren September 16, 2020

Really helpful. Thank you!

12 votes
MatthewC
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 27, 2012

Hi Chris,

randomly came across this looking for something else. Jamie's answer is right but there is something you should be aware of when using date searches like -1w.

-1w is short hand for -7 days which is translated into -7*24 = 168 hours. So if you run this on 15:00hrs on the 28th, your results would only include data from 15:00 on the 21st. Depending what time you run this, you get different results, even if no data has changed

if you're looking for anything resolved from 21st to 28th, then you would use this:

resolutiondate >= startOfDay(-7)

It also has the advantage that it timezone aware, so if you're sending results to users in different timezones, it tailors the results to suit the user's locale.

2 votes
MatthewC
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.
May 19, 2014

-7d is -7*24 hours == now() - 168 hours

So if you ran this query at 13:00, it would include from 13:00 7 days ago.

If you this query at 16:00, it would include from 16:00 7 days ago

startOfDay(-7) means that the time doesn't change during the day you run the query. https://confluence.atlassian.com/display/JIRA/Advanced+Searching+Functions#AdvancedSearchingFunctions-startOfDay%28%29

I think I also ran some test with users in different timezones and it adjusts to the users local time for start of day.

In essence, -7d is how a computer thinks, startOfDay(-7) is how humans tend to think.

1 vote
Vishnu Sanikommu June 20, 2017

resolutiondate > startOfWeek(-1w) AND resolutiondate < startOfWeek()

 

Can some of you please help me with query to fetch the data of resolved issues between Monday to sunday.

What is the startOfWeek in JIRA. Is it Monday or Sunday?. Does it include timezone too? If it is which timezone

 

Can some of you please help me with this issue.

0 votes
Vinay Vira January 31, 2018

Would anyone be able to help me with creating a query where I want to see all issues including closed ones as long as they were closed within the last 7 days.

I do not want to see issues where it was resolved more than 7 days ago.

Thank you

Vinay Vira January 31, 2018

I found my answer:

(Project = XYZ AND resolution = Unresolved) OR (Project = XYZ AND resolutiondate >=-1w)

Kevin Maes February 1, 2018

The answer is not the correct solution for your question.

Keep in mind that resolutiondate is not the same as the date the issue was closed. It depends on how your workflow is implemented.

status = closed and status was not Closed BEFORE startOfDay(-7)

combine this with resolution date if you need that as well

0 votes
Māris Leimanis November 7, 2017

I have almost the same problem but from other side. I want to filter out issues which were unresolved from 2017

project = myProject AND resolution was Unresolved ON startOfYear(2017) order by updated DESC

 

basically this JQL give me one issue, which was Resolved 03.04.2008 totally I have >3500 issues

0 votes
William Causey August 28, 2014

The result is I get only the Unresolved issues with this.

Just want to understand why our querry changed from giving only the resolved defects as it did 2 weeks ago? Or is the result expected for the Jira querry that we are running to get both resolved and Unresolved issues in this querry?

resolved >= startOfDay(-6d) ORDER BY resolved

0 votes
William Causey August 28, 2014

I also used this querry and it produces exactly what I wanted:

project = GVUKSUP AND resolved >= startOfDay(-6d) and resolution != Unresolved ORDER BY resolved

JamieA
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.
August 31, 2014

Maybe they were resolved then reopened? Or you have a resolution value called "Unresolved"?

Kevin Maes August 31, 2014

Resolved and then reopend was my first thought as well, but the value of resolved would be emptied again

0 votes
William Causey August 28, 2014

I have a question, we are running the following query:

resolved >= startOfDay(-6d) ORDER BY resolved

The problem we are getting some issues that are not resolved - they are still Opened and Unresolved.

The problem started just recently as the query was still working about 1 - 2 weeks ago. I would like to know what could have caused the change.

Kevin Maes August 28, 2014

Can you try running the following query:


resolved >= startOfDay(-6d) and resolution = Unresolved ORDER BY resolved

This would give you results then?

(trying to figure out if this is possible, because in my case it's always an empty resultset)

0 votes
Ivan Ovchynnikov May 20, 2014

Thanks a lot!
one more follow up question.
Would the following filters be equivalent?

resolutiondate >= startOfDay(-7)
resolved >= startOfDay(-7)

I am interested in what is the difference between resolutiondate and resolved.

MatthewC
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.
May 20, 2014

They are the same, one is an alias for the other

https://confluence.atlassian.com/display/JIRA/Advanced+Searching

0 votes
Ivan Ovchynnikov May 19, 2014

Thanks, this works! However, resolved > -30d worked for me as well. And the question-answers here also confirm it works: https://answers.atlassian.com/questions/74444/create-filter-with-relative-date

So, the follow-up question is,
is there a difference between following filters:
resolutiondate >= startOfDay(-7)
resolved >= -7d
?

Suggest an answer

Log in or Sign up to answer