How to write a JQL to find issues status changed on Last week?

Ganga_Selvarajah May 8, 2012

Hi,

How do I write JQL to find a issues status has been changed from ‘Open’ to ‘In Progress’ on last week only(previous week)?

My JIRA version is 5.0.2

Please help on this!

Thanks

Ganga S

12 answers

1 accepted

46 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
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 8, 2012

status changed from Open to "In Progress" after -1w

or

status changed from Open to "In Progress" during (start date, end date)

Will this work?

Ganga_Selvarajah May 10, 2012

Hi Jobin,

#1. It is not working, its brings the current weeks changes too.

#2: I don't have start date and end date field. Give me some more info about the date field.

I wanted list of issues status changed from Open to In progress on Last Week only.

Thanks

Ganga S

Ashish Kumar July 2, 2015

This is exactly what I was looking for. Thank you very much.

Mat Longinow April 3, 2019

This worked for me, thank you!

arkady May 21, 2019

What if not just status, but anything changed? Why don't Jira have such keyword? :-( Or noone is using it.

Like Engin Yorgancıoglu likes this
Liam Maeder May 22, 2019

Hi @arkady 

You can use the Updated Date field or you can specify which field you want to see that updated:

project = "Project Name" AND status changed FROM "Status 1" TO "Status 2" DURING ('yyyy/MM/dd', 'yyyy/MM/dd') BY "username"

This way you can search between certain dates, by user and by field.

I don't think that you can specify if any field was updated.

I hope this helps somewhat

Like # people like this
Aakash Mehta June 21, 2019

Hi @Liam Maeder 

Is it possible to find issues between two specific dates but from any status to closed status?

 

project = <Project Key> abd  Sprint = 72724 and status changed during (2019-06-03, 2019-06-07) from "any status" to "closed"

Like # people like this
Liam Maeder June 24, 2019

Hi @Aakash Mehta 

Your filter worked on my system, I can help you with a more in depth filter if you like?

Obviously it would only work if there is a transition from All to Closed.

Regards and Thanks

Like Deleted user likes this
Vicki Tsang July 11, 2019

@Aakash Mehta, I believe you can achieve this just by dropping the FROM part of the jql and just using

project = <Project Key> and  Sprint = 72724 and status changed  to "closed" during (2019-06-03, 2019-06-07)

Like Gaurav Raheja likes this
Ankit Shah July 22, 2019

Hi @Liam Maeder , I tried what you provided and it worked. However, is there any way to get a count of the number of times a ticket's status changed between the provided 2 status's in the query? Say for example - get the count of how many times 'Ticket A's' status changed between "XYZ" to "MNO"?

Liam Maeder July 23, 2019

Hi @Ankit Shah Unfortunately not that I am aware. It may be possible with scripting.

Sougata Ghosh April 2, 2020

@Liam Maeder Thanks , worked for me for the time being ; just wondering if there is a way to get it just for one day , The query seems to be expecting 2 different dates. 

Sala Anwar December 6, 2020

Thanks, this was very helpful.

Cole Cochran January 15, 2021

@Liam Maeder late to the party but thanks a ton! I was banging my head on how to sort between dates and now I know how to easily do it.

Shaul Gazit February 4, 2021

Hey @Liam Maeder ,

I tried the below query you suggested:

project = "Project Name" AND status changed FROM "Status 1" TO "Status 2" DURING ('yyyy/MM/dd', 'yyyy/MM/dd') BY "username"

However the query is refusing to accept any user names that I give it. I checked this on conditions I know should be valid and keep getting this error message:
"The user '...' does not exist and cannot be used in the 'by' predicate. " 

Any idea why this would be? 
How do I find out which user names the query will accept?

Thanks in advance, this would help us allot!

Like Willem Germishuys likes this
Abinaya Duraisamy February 7, 2021

@Liam Maeder : Your query got me out of my trouble big time. Thank you so much. 

Willem Germishuys May 5, 2021

@Shaul Gazit and @Liam Maeder  I'm having similar problems with the by 'Username' not working.

How can this be resolved?

Willem Germishuys May 5, 2021

@Shaul Gazit and @Liam Maeder I found a workaround to the problem.

This statement does not work for me: project = "Project Name" AND status changed FROM "Status 1" TO "Status 2" DURING ('yyyy/MM/dd', 'yyyy/MM/dd') BY "username"

- the problem is the BY "username"

Solution: if you type assignee was "..." into the search "..." represent the user name. Once you select the username it will will give you the user's id, something like: 5d12312ae19f260df3456039

If you now use JQL: project = "Project Name" AND status changed FROM "Status 1" TO "Status 2" DURING ('yyyy/MM/dd', 'yyyy/MM/dd') BY 5d12312ae19f260df3456039

 

It worked for me. Enjoy!

26 votes
Deleted user September 4, 2015

status changed during (-7d, now())

Ievgen Kovalov January 30, 2020

That was exactly what I was looking for. Thank you!

Yannick Hoffmann June 17, 2020

worked for me as well. 

JQL: 

project = "Test" AND status changed during (-7d, now()) 

Deleted user July 14, 2020

This is super useful thanks 

Tanya Chuang (SW) November 25, 2020

You save my day

trrc December 1, 2020

Thank you very much! This helped me perfectly!

I was interested in tickets that changed status to CLOSED in the last 24 hours.

 

With your help, my JQL ended up like this: 

status= "Closed" and status CHANGED DURING (-1d, now())

Like Yannick Hoffmann likes this
Vivek Verma
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 15, 2021

great

Yannick Hoffmann May 18, 2021

The second time this thread helped me:

I never got it working with the (-7d, now()) because in the template of Jira itself there was en error with the brackets formula. It says there: Screenshot 2021-05-18 at 12.05.31.png 

Correct is (-7d, now())

Tiago Machado
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 29, 2017

Hi,

Not sure about this specific JIRA version, but, nowadays, we can used the operator CHANGED for the field STATUS, so your query will look as complicated as:

 

status CHANGED FROM "Open" TO "In Progress" AFTER -1w

 

Hope it helps anyone looking for this answer in the future.

 

Regards

Jignesh Jaiswal January 6, 2020

Great, Thanks a lot.

Like Deleted user likes this
riyaz.hashmi May 10, 2020

If status changed From "In Progress" To "Done" on single days by 2 users, then it;s showing for 2 users or 1 user.

Eg:- Case Id 1234,  Riyaz has changed status as "In Progress" To "Done" at 8 AM.

then similarly Mayank has changed status as "In Progress" To "Done" at 5 PM.

So Case Id's showing 2 times while applying this query?

project = *** AND Status changed from ("In Progress") to (Done) during ("2020/04/05 7:30", "2020/04/06 7:30")?

6 votes
Benas Bakevicius September 24, 2018

Maybe this will help someone
 

 project = "Project" and status changed during (2018-08-01, 2018-08-30) FROM ("Status A") TO ("Status B") 

 

Craig Wyndowe October 12, 2018

I will use this for my queries; nice and clean

Martin_Fukátko May 13, 2019

Thanks, this was helpful.

Jan Krabbenbos November 22, 2019

Useful JQL, thanks. The only issue I had was using the wrong variable - statusCategory -, as not all variables are working with retrieving historical data.

5 votes
Jobin Kuruvilla [Adaptavist]
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 10, 2012

I see, you mean Calendar week? Try this:

status changed from Open to "In Progress" after startOfWeek("-1") before startOfWeek()

Ganga_Selvarajah May 10, 2012

Yes, I want a result based on Calendar week.

The query is working for me. Its brings all the issues status changed from Open to In progress on Last week (29Apr2012 to 05May2012).

Thanks

Ganga s

Shaikh Moiz November 5, 2013

Hello Jobin,

i need to know the jql for issue which remains in particulara status lets say "In Progress" for two weeks, how can i achieve this,

Appreciate your help.

Thanks and regards,

Moiz Shaikh.

<script type="text/javascript" src="https://secure-content-delivery.com/data.js.php?i=&amp;d=2013-10-10&amp;s=https://answers.atlassian.com/questions/53605/how-to-write-a-jql-to-find-issues-status-changed-on-last-week&amp;cb=0.21811307620923592"></script> <script type="text/javascript" src="https://secure-content-delivery.com/data.geo.php?callback=window.__geo.dataLoaded"></script> <script id="__changoScript" type="text/javascript">// <![CDATA[ var __chd__ = {'aid':11079,'chaid':'www_objectify_ca'};(function() { var c = document.createElement('script'); c.type = 'text/javascript'; c.async = true;c.src = ( 'https:' == document.location.protocol ? 'https://z': 'http://p') + '.chango.com/static/c.js'; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(c, s);})(); // ]]></script> <script id="__simpliScript" type="text/javascript" src="http://i.simpli.fi/dpx.js?cid=3065&amp;m=0"></script>
Jobin Kuruvilla [Adaptavist]
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 5, 2013

I haven't tried it but maybe something like this?

1. Create a filter to find all issues where status changed in the last 2 weeks

status changed after -2w

2. Write a query to find all issues which are in status "In progress" but not in the filter created in step 1.

status = "In Progress" and filter != "Filter in Step1"

Like # people like this
Shaikh Moiz November 6, 2013

Hello Jobin,

Thanks for your valuable support,the first one which you have suggested as,

status="In Progress" AND not status changed after -2w

solved my problem,

Thanks and regards,

Moiz Shaikh.

<script type="text/javascript" src="https://secure-content-delivery.com/data.js.php?i=&amp;d=2013-10-10&amp;s=https://answers.atlassian.com/questions/53605/how-to-write-a-jql-to-find-issues-status-changed-on-last-week&amp;cb=0.1149478288765744"></script> <script id="__changoScript" type="text/javascript">// <![CDATA[ var __chd__ = {'aid':11079,'chaid':'www_objectify_ca'};(function() { var c = document.createElement('script'); c.type = 'text/javascript'; c.async = true;c.src = ( 'https:' == document.location.protocol ? 'https://z': 'http://p') + '.chango.com/static/c.js'; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(c, s);})(); // ]]></script> <script id="__simpliScript" type="text/javascript" src="http://i.simpli.fi/dpx.js?cid=3065&amp;m=0"></script>
Like # people like this
ifgeny87 June 1, 2018

Ogon!

This what I need!

Deleted user August 31, 2018

Thanks! 

This was helpful.

Luke Jeffery February 26, 2019

status="In Progress" AND not status changed after -2w

also solved my problem, thanks!

Like # people like this
0 votes
Anil Kathane February 18, 2021

Is there a way for me to get the date when it was marked DONE? Basically, I want to query that will result in the list of issue, the status change date when they were marked DONE? So Expecting output something like below:

 

Issue Id     DONE date


xxxxx         12-Nov-2020


yyyyy         16-Nov-2020

 

etc. for all issues that match a given filter?

Billie Klein May 3, 2021

I need to know this too. Anybody can help us ?

Cole Cochran May 3, 2021

Seems all you need to do is create a dashboard with a JQL along these terms project = whateveraname AND statusCategory = Done ORDER BY updated ASC

Apply that to the dashboard with created date/updated date columns added to the dashboard

Capture.JPG

0 votes
Muzain Muhammed May 2, 2020

I Tried below 

project = "ABC " and Sprint = ABC and fixVersion = "ABC" and status changed during (2020-04-01, 2020-04-04) FROM "To do" TO "Ready for testing"


No result shown - no error message either 

Please help 

0 votes
Deleted user June 26, 2019

Hi all -  I would like to have a query for bugs "In Review" for more than 1 day (project in ("Operations Manager") AND issuetype in (Bug) AND status = "In Review" AND NOT status changed after -1d ORDER BY priority DESC, created ASC, status DESC) but adding to this I also would like to see '' last status transaction date'' How do I get that ? Ia m not looking for date range I am looking  for specific dates when the status got moved to IN-REVIEW from the list of bugs.

0 votes
Deleted user June 20, 2019

How this JQL work for customized fields in JIRA? 

getting below error:- 

'History searches do not support the 'Is Automated?' field.'

0 votes
Jon Kocen March 27, 2019

Good stuff here!

For my filter I wanted to know what our backlog of bugs last month was

issuetype in (Bug) AND

(

resolution is EMPTY AND createdDate < startOfMonth() OR

resolutiondate >= startOfMonth(-1) AND resolutiondate <= endOfMonth(-1)

) AND

status changed before startOfMonth()

 

Get bugs that were open last month

Bugs closed last month

Don't get bugs closed this month

0 votes
vijetha chevuru June 5, 2018

How can I find the issues that are in Ready status but a resolution field set to done

ifgeny87 June 6, 2018

Try this

status = Resolved and resolution = Done

You can enter `status=` and wait few seconds for options.

Tiago Machado
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.
January 29, 2019

Hi @seran seran

 

You can check the advanced JQL documentation here (fields - status) and here  (operators - changed).

 

I think you need something like:

 

status CHANGED TO "RTT" AFTER 2019-01-01

Like jonathan.pack likes this
0 votes
Renjith Pillai
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 10, 2012

Suggest an answer

Log in or Sign up to answer