views:

483

answers:

3

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?

A: 

You would expect that this is easily possible but that seems not be the case. The only way I see at the moment is to create a user defined JQL function. I never tried this but here is a plug-in:

http://confluence.atlassian.com/display/DEVNET/Plugin+Tutorial+-+Adding+a+JQL+Function+to+JIRA

Stefan Egli
thanks, I'll have a look tomorrow at work
Shevek
having loads of trouble getting the MAVEN plugin to install in Eclipse :(
Shevek
I have not much experience with eclipse, I usually use netbeans. Though I did not try much or anything with maven yet, I think it should be easy if you install the full netbeans installer...
Stefan Egli
A: 

You might use one of our plugins: the JQL enhancement functions - check out https://plugins.atlassian.com/plugin/details/22514

There is no interval on day, but we might add it in a next iteration, if you think it is usefull.

Francis.

Francis Martens
@Francis-Martens - that looks like exactly what we need, it's actually week calculations that we need to perform although if you could add a Day interval that would be great. I've passed it to our JIRA admin and we'll test it. I'll let you know how we get on.
Shevek
@francis: is the plugin time zone aware? I've tested it with the week interval and it seems to be returning dates on Mondays with a time of 12:00:00.000 I checked the code in the repository and it should be returning 00:00:00.000 (if I read the Java correctly, I'm not a Java dev!)
Shevek
@francis: I am in the UK btw
Shevek
Sorry for the late answer.There is indeed a bug with the timezone calculation It has been file'd under https://studio.plugins.atlassian.com/browse/IJQL-7We'll get it fixed in the course of the week (and we'll add support for day in the mix)Francis
Francis Martens
A: 

A friend who is a JIRA wiz showed me that you can actually pass the filter (escaped) as a jqlQuery parameter to JIRA via URL:

http://hostname/secure/IssueNavigator!executeAdvanced.jspa?clear=true&amp;runQuery=true&amp;jqlQuery=created%3E='2010-05-31%2000:00'%20AND%20created%3C='2010-06-06%2023:59'%20ORDER%20BY%20created%20ASC

I created an ASP.Net page which generates the URLs based on an offset week or month.

Everybody's happy!

Shevek