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 to show issues where status changed from one to another within the last hour

I'm trying to write a query that will return all of the tickets where the status changed FROM 'StatusA' TO 'StatusB' DURING (current date/time -1h, current date/time).

At first I was hoping that the now() function would work, but it appears that arguments cannot be passed to it.

Trying to make this dynamic so that I don't have to update the query every hour -- because that just isn't realistic.

 

Any thoughts?

1 answer

1 accepted

0 votes
Answer accepted
Jack Community Leader Jan 13, 2020

you can use this JQL or similar.

updated >= "-2h" and updated <= "-1h"

Except I don't believe that would link directly to the status change from A to B.
That would flag any issues that have been updated between that hour/time difference that have ever moved from A to B (regardless of when).

Example:
Issue changes from A to B on 12/15/2019
Today is 1/13/2020 and someone makes some sort of update to the ticket within the last hour.
I would expect that the issue would now appear in the filter I am trying to set up -- in this scenario I wouldn't want it to.

This is where status changed from (A) to (B) during (date1, date2) works nice for date ranges. Doesn't work for trying to reference the last hour.

Jack Community Leader Jan 13, 2020

I think you can accomplish your goal but you need to tweak it a bit to meet your needs. Here is an example....

status changed FROM "to do" to "done" after "-2h" and status changed FROM "to do" to "done" before "-1h"

LMK...

Like Fernando Bordallo likes this

Aha!

So, after reading your most-recent reply, I've figured out what I needed to do.

Like I said in the beginning, I was trying to pass arguments to the now() function - which I knew didn't work.

From my example I originally provided, I've only ever passed dates after during in my query ex: during (date1, date2)

 

So, in the end...

What I was trying to do (which DOES NOT work):
status changed from (A) to (B) during (now(-1h), now())

What I needed to do (which DOES work):
status changed from (A) to (B) during (-1h, now())

 

Typically my queries consist of a lot of date changes, so I use startOfDay(), endOfDay() quite a bit and pass day change arguments to those (ex: -1d)

I never thought to just pass a hour change not inside of an actual function.

 

Thanks for providing an example that guided me to what I really wanted.

Like Fernando Bordallo likes this

I think "now()" in this case is redundant. A simpler request will be

status changed from (A) to (B) after -1h

is it correct?

Like Joel Lepp likes this

That makes sense. Like I think I said somewhere in my reply in this chain, my filters typically deal with dates and have always been a date range - that's why my mind went to the DURING approach I guess.

You are correct though. Using after -1h would achieve the same thing. Thanks for pointing it out as another solution.

Like Anton_Ermolaev likes this

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