Needing to add a Date/Time to a JQL Query.

Lloyd May 6, 2022

Hello all,

 

I'm rather new to JQL queries but I am needing to use one in order to produce data recorded within a week, for example, to use a JQL query to show all data entered last week.

 

What I have got right now that functions are: project = XYZ AND issuetype in (ABC, DEF) AND status = Open ORDERBY priority DESC, updated DESC.

The above will show me all results that are currently on show but when one of those status change for example from "Open" to "Closed"  it will disappear from the list as it no longer meets the criteria to be shown.

So what I'm trying to figure out, is there a way to show the data for example from 25/04/2022 to 02/05/2022?

I have looked on here for a while to try and figure out this for example by using "AND updateDate >= (DATE)" but it returns an error so I'm sure if I'm using it correctly.

 

Any help would be gratefully received, the dates I've put down are in the UK format before anyone gets confused.

 

Thank you.

 

 

 

 

 

3 answers

1 accepted

0 votes
Answer accepted
Alberto Salvante
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 6, 2022

Hi Lloydduckworth and welcome to the Community!

You can try some of this examples:

created > "2022-04-01" and created < "2022-04-30"
updated > "2022-04-01" and updated < "2022-04-30"

createdDate > "2022-04-01" and createdDate < "2022-04-30"
updatedDate > "2022-04-01" and updatedDate < "2022-04-30"

Hope it helps.

Best,
Alberto

Lloyd May 9, 2022

Hi Alberto,

 

Thank you for the insight on how to tackle my issue, I have tried an example and am making good progress, but is it possible to take it a step further to show results with specific labels such as "Open", "Closed" and "Rejected" for example?

 

Thank you,

Lloyd.

Alberto Salvante
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 9, 2022

Hi Lloyd,

just add "AND status in ("Open", "Closed","Rejected")".
Can you please accept my answer if it helped. Thank you.

Best,
Alberto

Lloyd May 9, 2022

Hi Alberto,

 

Thank you again for your assistance, I've been having difficulty trying to get my head around this for the past 2 weeks I'm sure I wouldn't forget this in a hurry.

 

Lloyd.

Lloyd May 9, 2022

Alberto,

 

Just to add to my previous message with a physical label within Jira is it possible to use that to search amongst various past tickets rather than using a physical status such as Open, Closed, Rejected as that's what really my goal is.

 

Is it possible to search using "labels" rather than Status?

Thanks again,

Lloyd.

0 votes
CJ Edwards May 6, 2022

The error you mention can also be the format itself and what the JQL is expecting

For instance

created >= "01-01-2022"

returns 

 

Date value '01-01-2022' for field 'created' is invalid. Valid formats include: 'yyyy/MM/dd HH:mm', 'yyyy-MM-dd HH:mm', 'yyyy/MM/dd', 'yyyy-MM-dd', or a period format e.g. '-5d', '4w 2d'.
Lloyd May 9, 2022

Hello CJ,

 

Thank you for the assistance, it's helped me move a step closer to my end goal.

Like CJ Edwards likes this
0 votes
Carlos Garcia Navarro
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 6, 2022

Suggest an answer

Log in or Sign up to answer