How to filter issues by date range?

Jason Bane January 3, 2019

I am looking to create a filter for a project that will show the issues created in a certain date range but am having issues creating the syntax. I'm lost on how to create the date range. Any help would be appreciated!

6 answers

1 accepted

13 votes
Answer accepted
Taranjeet Singh
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 7, 2019

@Jason Bane As an example, if you want to search for issues created between a date range 1 Jan 2018 to 31 Dec 2018, and want to list them in desceding order by creation date, you can use the below JQL query for your filter:

 

project = "your-project-name" AND created >= "2018-01-01" AND created <= "2018-12-31" order by created DESC

 

Please let me know if this helps!

Olaf Troike January 2, 2020

With this JQL the issues from 31 DEC 2018 are not in the list. 

I think, this is the right one:

project = "your-project-name" AND created >= "2018-01-01" AND created <= "2019-01-01" order by created DESC

Like # people like this
NVDV Tester July 29, 2020

Technically <= '2018-12-31' should bring defects from 2018/12/31 and prior
I don't know why it is not working that way

And 

the date with or without quotes is working the same way. Meaning '2018-12-31' or 2018-12-31 work the same way.

Like Sanjog Sigdel likes this
Manimaran Sundaramurthy August 27, 2020

I'm using reset API to get the issue details using python requests and it seems like date range is not working.

Suppose I wanted to extract the issue details which has been updated/created between 1st Jan 2018 to 31st Dec 2018. I have tried using below format and it returns all the issue's which has been updated greater than 1st Jan 2018 to till date and not limited to Dec 31 2018. 

https://xxx-jws.atlassian.net/rest/api/3/search/?jql=updatedDate>='2018-01-31&updatedDate<='2018-12-31'

Can someone help on this to retrieve issue's updated or created between date range

Like Sanjog Sigdel likes this
Vetrivel Muruga T R April 27, 2021

For '2018-12-31', system internally treats this as '2018-12-31 00:00:00'.
The createddate is internally stored with time.

Hence you didn't get the jiras created on 31 DEC 2018.

Hope it clarifies.

Like # people like this
2 votes
Rafael Garcia Tamarit March 13, 2023

Hi everyone,

I have an additional doubt that I have not seen addressed.

Is it possible to filter issues for a specific range of dates, delimited by certain months without having to specify the year?

I am interested in filtering all issues outside "july 1st - any year" and "august 31st any year".
I do not want to use this filter: createdDate < 2023-07-01 AND createdDate > 2023-08-31

I have been exploring functions startOfMonth() and endOfMonth() but I do not see in the syntax, how to include a specific month inside the parenthesis ()...

It would be nice if we could use something like this:
createdDate < startOfMonth(july) AND createdDate > endOfMonth(august)

Hope you have some nice idea. Thanks in advance for your help!

Ramachandra Reddy_S August 23, 2023

Do we have aby solution to pass  startOfDay/  startOfWeek/ startOfMonth as a parameter to extract the data ?

1 vote
Chris August 29, 2022

Hey Guys,

i've got a similar question. I guess, its easy for you guys, but i dont get it.

I'd like to create a filter that shows me incidents created only on a specific weekday; let's say monday.

so i'd like to know which requests are created on mondays.

Got help for me? :)

Thanks and greets

Chris

1 vote
Madinah Ramji February 23, 2022

Having a similar issue, not sure if this is the right way to ask this!

My goal: have a queue that filters 3 request types in a specific date range.

 

This is the JQL I have currently.


"customer request type" = "Courier Request" OR "Customer Request Type" = "Leavers (P&C ONLY!)" OR "Customer Request Type" = "Joiners (P&C ONLY!)" AND "Ship Date" >= 2022-01-21 AND "Ship Date" <= 2022-02-18

 

The queue is currently filtering the correct request types, but the date part of the JQL is not working.  

Vetrivel Muruga T R February 23, 2022

Dear Madinah,

When we use multiple boolean conditions together, the order of precedence would be as "AND" >> "OR" 

Hence your query will be treated as below. Observe the parenthesis (brackets) put by me.

"customer request type" = "Courier Request" 
OR
"Customer Request Type" = "Leavers (P&C ONLY!)"
OR 
(
"Customer Request Type" = "Joiners (P&C ONLY!)"
AND
"Ship Date" >= 2022-01-21
AND
"Ship Date" <= 2022-02-18
)

To get the expected result, you need to use appropriate parenthesis where ever necessary. Like below


"customer request type" = "Courier Request"
OR
"Customer Request Type" = "Leavers (P&C ONLY!)"
OR
"Customer Request Type" = "Joiners (P&C ONLY!)"
)
AND
"Ship Date" >= 2022-01-21
AND
"Ship Date" <= 2022-02-18

Moreover you can use the "IN" condition as below to improve the readability and it may possibly increase the performance also.

"customer request type" in ( "Courier Request" , "Leavers (P&C ONLY!)" , "Joiners (P&C ONLY!)" )
AND
"Ship Date" >= 2022-01-21
AND
"Ship Date" <= 2022-02-18

 

Another important point that, still the above query may not get the ShipDate of 2022-02-18.

To solve that you have to do as

            "Ship Date" < 2022-02-19

Like Sanjog Sigdel likes this
0 votes
Michael Gonzalez September 9, 2020

Hello, I am having a similar issue. I would like to use the time entry date and not "created". When I try it I get a syntax error. 

 

Instead of this: created  > startOfMonth(-13)

 

I would like this: Time Entry Date  > startOfMonth(-13)

 

Is this possible?

Vetrivel Muruga T R June 30, 2021

Dear Michael Gonzalez,

Your question is not clear. That's why i think still unanswered by anyone. Can you please elaborate it ?

0 votes
Fazila Ashraf
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 4, 2019

Hi @Jason Bane

You could use something like this:

project=xyz and created  > startOfMonth() and created < endOfMonth()

 gets the xyz issues created in the current month. Refer to other functions in https://confluence.atlassian.com/jirasoftwarecloud/advanced-searching-functions-reference-764478342.html

 

You can also give specific dates instead of date functions.

Suggest an answer

Log in or Sign up to answer