Advanced searching between hours of the day

Geir-Stian Svendsen September 27, 2011

Say, if I wanted to search issues that were resolved between 08:00 and 16:00, how would the syntax look?

I've found out how to search specific times, but thats not really helping.

hope you guys can help.

3 answers

2 votes
Pazera Blazej November 6, 2014

Hi All,

Above examples shows only how to search issues from certain day.

What if i would like to search for all issues ever, created between 08:00 and 16:00.

 

Cheers.

 

0 votes
GilesG November 14, 2011

Hi Geir-Stian and milowe,

@milowe, I think your syntax for the 'startOfDay()' function is correct, but according to our Advanced Searching page in our JIRA documentation (which is effectively a JQL reference guide), I don't believe you can use the 'resolved' field with the 'startOfDay()' function together in a JQL clause.

Try the following syntax instead:

resolved > "yyyy/MM/dd 08:00" AND resolved < "yyyy/MM/dd 16:00"

where 'yyyy/MM/dd' represents the date - e.g. the current date.

See the 'Resolved' field on the 'Advanced Searching' page for details.

Cheers,

Giles.

P.S. Having said that, please correct me if I'm wrong (so we can fix up the documentation :-) ).

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.
November 14, 2011

Well Giles, your are supposed to be the expert :)

Your example is correct for any Jira version.

The example I provided is valid for Jira version 4.3+ when I think relative dates such as startOfDay was intoduced.

The relative dates are more useful if you use filters since you dont have to retype the dates for each search.

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.
November 14, 2011

I forgot to mention that I actually tried my jql query for correctness before posting.

GilesG November 15, 2011

Aha - thank you milowe! Looks like our documentation needs updating :-) Will get on to that.

Thanks!

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.
November 15, 2011

Sure thing. This of course also applies to simiiar fields such as created, updated,...

GilesG November 16, 2011

Thanks milowe,

FYI - I've made the following update to the 'Advanced Searching' documentation:

These updates have also been implemented on the equivalent page of the JIRA 5.0 (Beta) documentation.

Cheers,

Giles.

0 votes
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.
November 14, 2011

resolved > startOfDay("+8h") AND resolved < startOfDay("+18h")

Suggest an answer

Log in or Sign up to answer