Forums

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

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

Glenn
Contributor
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 Champion
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
Contributor
November 20, 2017

I got it. Thanks  Tarun Sapra. 

Paul.j
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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
Contributor
August 5, 2022

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

Like # people like this
Dave Liao
Community Champion
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).

15 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
Contributor
November 20, 2017

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

Like Jim Karpe likes this
Glenn
Contributor
November 20, 2017

Thanks Tyler! 

1 vote
Paul.j
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 22, 2021

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

Yuliia_Borivets__SaaSJet_
Atlassian Partner
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
Contributor
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 

Like Andrei Ancas likes this
Yuliia_Borivets__SaaSJet_
Atlassian Partner
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
TAGS
AUG Leaders

Atlassian Community Events