Filtering issues by exact date in JQL

I’m having trouble with JQL queries for getting issues from a specific day. Here’s what I’ve tried:

project=\"myproject\" created >= -2d and created < -1d

This gives me issues from both -2d and -1d. Using > instead of >= doesn’t change anything.

I also tried:

project=\"myproject\" created >= 2023-03-01 and created < 2023-03-02

This works correctly for March 1st. But these queries give the same results:

created > 2023-03-01 and created < 2023-03-02
created > 2023-03-01 and created <= 2023-03-02

The createdDate field doesn’t help either.

Is there a way to get issues from just one day using the -days syntax without messing up the results? Any tips would be great!

hey liamj, i’ve run into this too. the startOfDay() function is your friend here. try this:

project=“myproject” AND created >= startOfDay(-2d) AND created < startOfDay(-1d)

it’ll grab everything from exactly 2 days ago. works like a charm for me!

I’ve dealt with similar JQL quirks before, and it can be frustrating. One trick that’s worked well for me is using the ‘startOfDay()’ function in combination with the ‘@’ symbol for relative dates. Here’s a query that might help:

project = “myproject” AND created >= startOfDay(@-2d) AND created < startOfDay(@-1d)

The ‘@’ ensures you’re anchoring to the current date, which can be crucial for consistent results, especially in automated reports or dashboards.

Also, don’t forget about time zones! If you’re working across different time zones, you might want to specify the time zone in your query:

project = “myproject” AND created >= startOfDay(“2023-03-01”, “America/New_York”) AND created < startOfDay(“2023-03-02”, “America/New_York”)

This approach has saved me countless headaches when dealing with date-specific JQL queries. Hope it helps you too!

I’ve encountered similar issues with JQL date filtering. From my experience, the most reliable way to get issues from a specific day is to use the ‘startOfDay()’ and ‘endOfDay()’ functions. Try this query:

project = “myproject” AND created >= startOfDay(-2d) AND created < startOfDay(-1d)

This should give you all issues created exactly 2 days ago. For a specific date, you can use:

project = “myproject” AND created >= startOfDay(“2023-03-01”) AND created < startOfDay(“2023-03-02”)

These functions ensure you’re capturing the full 24-hour period without any timezone issues. They’ve been a lifesaver for me in getting precise date ranges in Jira.