Forums

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

Trying to search defects based on a certain date

NVDV Tester July 29, 2020

I am trying to filter defects using a JQL on a on-prem JIRA, like

project = <project_name> AND issuetype = Bug AND status not in (Done, Closed) AND created <= 2020-07-23 ORDER BY labels ASC, key ASC, priority DESC, updated DESC

But it is not bringing in the defects created on the date 2020-07-23. Also the date with or without any type of quotes is working the same. Looks like they are optional.

Some where I read that if I use, it would work as expected

project = <project_name> AND issuetype = Bug AND status not in (Done, Closed) AND created < 2020-07-24 ORDER BY labels ASC, key ASC, priority DESC, updated DESC

 Actually, it is bringing defects, as expected. Why the Query is not working as expected.

1 answer

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
July 29, 2020

@NVDV Tester it is because "created" contains also time information and "2020-07-23" is evaluated to "2020-07-23 00:00". So you can really use "2020-07-24" but my suggestion is to use "2020-07-24 00:00"

NVDV Tester July 30, 2020

Thanks Martin !
But that does make the problem I am facing even more odd. Why ? If it is counting time from 00:00, it should consider all the issues that are created on 07/23. Is it not ?

As a logical thing, I want to use 2020-07-23 HH:mm. But I don't know which HH:mm would pickup defects from the entire date of 2020-07-23.

Martin Bayer _MoroSystems_ s_r_o__
Community Champion
July 30, 2020

your original condition looks like 

created <= 2020-07-23 

it is evaluated like 

created <= "2020-07-23 00:00"

and it means your issue would need to be created at 00:00 on 23rd july to match the condition

First minute of a new day is 00:00 and last minute is 23:59. 

NVDV Tester July 30, 2020

Logically, I can understand what you mean. 

But programmatically, I need to retrieve the defects created on the date of  2020-07-23. But by using '2020-07-23 00:00', I am still not getting the defects created on July 23rd. Only thing which is working is using '2020-07-24'.

Obviously, I am missing some thing.

Martin Bayer _MoroSystems_ s_r_o__
Community Champion
July 30, 2020

yeah you have to use this value...my answer was I would use "2020-07-24 00:00" because I am programmer too and implementation should be as clean as possible for other programmers. Everyone will understand that condition X < "2020-07-24 00:00" will match only X which is 2020-07-23 with any time part and all dates below

Suggest an answer

Log in or Sign up to answer