Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to query for issues that have a Target End in the past?

Sofie Palacios January 2, 2024

For example, I would like to see all issues whose target end is from today backwards... if that makes sense. 

Right now, it looks something like this, but this is clearly very incorrect... 

"Target end" > startOfDay() AND "Target end" <= startOfDay(-0d)

Any help would be amazing!!

3 answers

1 accepted

2 votes
Answer accepted
Geethanjali Katagani
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 3, 2024

Hi @Sofie Palacios ,

For your requirement, the JQL "Target end < startOfDay()" should suffice based on your example. You can go ahead and remove " Target end > startOfDay() AND" and test. If you're looking for issues with a target end date that goes back from today, consider using the following JQL:

"Target end <= startOfDay()"

Thanks, 

Geethanjali

1 vote
Mykenna Cepek
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 2, 2024

And to help with understanding how to do these kinds of date checks in JQL...

The original query:

"Target end" > startOfDay() AND "Target end" <= startOfDay(-0d)

when translated to words would be:

"Target end" date is after the most recent Midnight AND "Target end" is before or equal to the most recent Midnight.

No date is going to match both of those conditions. It's never true that A>B and A<=B.

-  -  -  -  -  -  -

Now you might want to ponder what you mean by "Today". That might be any of these:

  • The most recent Midnight
  • The time and date right now
  • The next Midnight

The JQL equivalents for the above, in order, are:

  • startOfDay()
  • now()
  • startOfDay(1)
0 votes
Clark Everson
Community Champion
January 2, 2024

Hi A Sofie,

 

Based on your example question the JQL would be 

"For example, I would like to see all issues whose target end is from today backwards... if that makes sense. "

 

"Target end" <= startOfDay()
Per my custom ChatGPT bot, I verified it works!
Best,
Clark

Suggest an answer

Log in or Sign up to answer