Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JIRA JQL searching by date - is there a way of getting Today() (Date) instead of Now() (DateTime)

I am trying to create some Issue Filters in JIRA based on CreateDate.

The only date/time function I can find is Now() and searches relative to that, i.e. "-1d", "-4d" etc.

The only problem with this is that Now() is time specific so there is no way of getting a particular day's created issues.

i.e. Created < Now() AND Created >= "-1d"

when run at 2pm today will show all issues created from 2pm yesterday to 2pm today
when run at 9am tomorrow will show all issues created from 9am today to 9am tomorrow

What I want is to be able to search for all issues created from 00:00 to 23:59 on any day. Is this possible?

like image 608
Shevek Avatar asked Apr 26 '10 13:04

Shevek


People also ask

How do you write a date in JQL?

__JQL Date Time Formats Or use "w" (weeks), "d" (days), "h" (hours) or "m" (minutes) to specify a date relative to the current time. The default is "m" (minutes). Be sure to use quote-marks ( " ); if you omit the quote-marks, the number you supply will be interpreted as milliseconds after epoch (1970-1-1).

How do I select a date range in Jira?

Use your system date formate in the JQL filter. For example: updatedDate >= "2018/10/01" and updatedDate <= "2018/10/31" (dont forget the quotes).

Can you do subqueries in JQL?

Subqueries can be used in native JQL just like the rest of JQL Search Extensions keywords. This means they integrate well with advanced search, filters, gadgets and any other Jira components that use standard JQL.


1 Answers

Check out startOfDay([offset]). That gets what you are looking for without the pesky time constraints and its built in as of 4.3.x. It also has variants like endOfDay, startOfWeek, startOfMonth, etc.

like image 192
Rob Allen Avatar answered Sep 25 '22 20:09

Rob Allen