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

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

Christopher Grantham Mar 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

20 votes
Answer accepted
JamieA Mar 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 Mar 18, 2012

Thanks for that, it solved my problem. :)

JamieA Mar 18, 2012

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

Mohammed Rashid Jan 26, 2014

You saved my day. Worked like a champ

SheikI Jan 11, 2015

thanks.. working fine.. :)

12 votes
Matthew Cobby Sep 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
Matthew Cobby 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 Jun 20, 2017 • edited

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
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
?

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.

Matthew Cobby May 20, 2014

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

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

0 votes
William Causey Aug 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 Aug 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
William Causey Aug 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 Aug 31, 2014

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

Kevin Maes Aug 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 Aug 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
Māris Leimanis Nov 07, 2017 • edited

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
Vinay Vira Jan 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 Jan 31, 2018

I found my answer:

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

Kevin Maes Feb 01, 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

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Jira Software

Demo Den Ep. 5: Meet Jira Mobile

See how to use Jira on the go! Demo Den Episode 5 is here: meet Jira Mobile with  Jira  Product Manager Rayen Magpantay.  Demo Den is in our monthly series where a Jira PM demonstrates...

218 views 1 9
Join discussion

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