how can I create a jql filter with time range between two dates

Glenn November 20, 2017

Hi 

 

Is there a way I could filter an issue within a specific time but also it has an interval date?

 

Something like this:

Night Tickets

project = SO AND created > "2017/11/20 22:00" AND created < "2017/11/21 6:00"

 

I would like to know the number of tickets by night within a single day.

3 answers

1 accepted

20 votes
Answer accepted
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 20, 2017

Hello Glenn,

For dynamic dates , you can do something like

project = SO and created > startOfDay("-2h") and createdDate <  startOfDay("+5h")

 This will give you night tickets for every day. I.e. tickets created between 10 pm (last day) and 5 am (of current day) 

Glenn November 20, 2017

I got it. Thanks  Tarun Sapra. 

Paul.j April 22, 2021

The above query is really useful. How to get the same data for a week/month between 10 PM 5 AM?

Like # people like this
Richard Cross August 5, 2022

what's the difference between "created" and "createdDate"?

Like # people like this
Dave Liao
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 22, 2022

@Richard Cross - there's no difference, one's an alias (but don't ask me which one!). 😅

If you have any other questions, definitely start a new thread on Community! (Click Ask the community in the header).

14 votes
Tyler Brown
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 20, 2017

Hey Glenn,

You certainly can, just use:

createdDate >= "2017-11-16 14:00" and createdDate <= "2017-11-16 23:00"

That should give you the tickets created during the specific time window you are looking for.

Hope this helps,

Tyler

Glenn November 20, 2017

Ohh I forgot to mention the current date must be dynamic upon creation of ticket

Like Jim Karpe likes this
Glenn November 20, 2017

Thanks Tyler! 

1 vote
Paul.j April 22, 2021

How to get last one week/month ticket created between 10 PM to 8 AM?

Yuliia_Borivets__SaaSJet_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
April 22, 2021

Hi @Paul.j 

I'm not the JQL expert, but the following query works for me:

project = ProjectName and created >="yyyy/MM/dd 10:00" AND created <="yyyy/MM/dd 08:00"

Hope this helps.

Best regards

Like curtking likes this
Sylvain Leduc January 6, 2022

Hello, not sure what you meant but writing 

created >="yyyy/MM/dd 10:00" AND created <="yyyy/MM/dd 08:00"

 

does not work : you have to specify year/month/day or else use startofday() etc 

Yuliia_Borivets__SaaSJet_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
August 5, 2022

Yes, you should specify year/month/day. That was only an example.

Like curtking likes this

Suggest an answer

Log in or Sign up to answer