How to filter/query for dynamic date/time

kevin jamieson October 24, 2011

I'd like to create a filter that grabs records where the resolutiondate < 12AM that morning.

resolutiondate < -1d gets me part of the way there, however bugs resolved less than 24 hours ago, but still on yesterday's date, will not show up until after the time they were resolved the previous day.

resolutiondate < "-1d 8h" gets me pretty close, but I'd like to be able to supply a date/time parameter.

So anything where I can assign a value to just the time, use a calculation in the query (-1d + datediff between now and midnight), or even just truncate the time from a date would work.

Thanks.

2 answers

1 accepted

0 votes
Answer accepted
Mikael Löwenadler
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.
October 24, 2011

Not quite sure what you are after.

How about ... resolutiondate < now() and resolutiondate >= startOfDay()

That would get the ones resloved by midnight. You could use startOfDay("-1d") instead if you want to include the ones for the previous day as well.

kevin jamieson October 24, 2011

startOfDay() would totally have worked, but JQL doesn't seem to like it.

Unable to find JQL function 'startOfDay()'.

Mikael Löwenadler
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.
October 24, 2011

I guess startofDay() was introduced in Jira 4.3 so if you have an earlier version that wouldnt work.

You could always write a report plugin, should be quite simple.

0 votes
Jeff Kirby
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.
October 24, 2011

This is unfortunately not possible in Jira. It could be done by introducting a new JQL date function function, I suppose. Something like resolutiondate < timeSince("0")

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events