SearchBuilder and time intervals

I’m having a problem doing time interval searches in RT. What I want is
Owner = ‘11510’ AND
Resolved > datesub(curdate(), interval 2 weeks)

The above syntax works for MySQL (which is what I’m using).
Unfortunately, SearchBuilder doesn’t seem to do the right thing with
this. I’ve also not found a way to get this to work from the
documentation. Have I missed something or is this simply impossible?

RT’s ticketsql actually should be able to handle this somewhat more
simply:

Owner = ‘jesse’ AND Resolved > ‘2 weeks ago’

works for me :)On May 29, 2008, at 1:35 AM, Brian Gallew wrote:

I’m having a problem doing time interval searches in RT. What I
want is
Owner = ‘11510’ AND
Resolved > datesub(curdate(), interval 2 weeks)

The above syntax works for MySQL (which is what I’m using).
Unfortunately, SearchBuilder doesn’t seem to do the right thing with
this. I’ve also not found a way to get this to work from the
documentation. Have I missed something or is this simply impossible?


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

PGP.sig (186 Bytes)

Jesse Vincent wrote:

RT’s ticketsql actually should be able to handle this somewhat more simply:

Owner = ‘jesse’ AND Resolved > ‘2 weeks ago’

works for me :slight_smile:

Wow, do I feel stupid!

RT folks,

I’ve got a number of saved-query boxes on my RT home page to keep track
of various classes of tickets I own or am watching. I’d like to make
them available to my co-workers without having to rewrite the query for
each user.

Is there a way to create a query that refers to the current user who
happens to be making the query? Something like “Owner = self()”?

Given how the “n highest priority tickets I own” query seems to work,
I’m suspecting the answer is “no”, but I figured it was worth asking.
If the feature isn’t here at present, is it planned?

Owner=“CurrentUser” may work if you do an Element (like MyTickets or
MyRequests) to embed on the page

Aaron D. Ball wrote:

RT folks,

I’ve got a number of saved-query boxes on my RT home page to keep track
of various classes of tickets I own or am watching. I’d like to make
them available to my co-workers without having to rewrite the query for
each user.

Is there a way to create a query that refers to the current user who
happens to be making the query? Something like “Owner = self()”?

Given how the “n highest priority tickets I own” query seems to work,
I’m suspecting the answer is “no”, but I figured it was worth asking.
If the feature isn’t here at present, is it planned?


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Drew Barnes
Applications Analyst
Network Resources Department
Raymond Walters College
University of Cincinnati

Drew Barnes wrote:

Owner=“CurrentUser” may work if you do an Element (like MyTickets or
MyRequests) to embed on the page

Thanks! That did it. Is there a reference somewhere where I can see
the available substitutions? I didn’t see them mentioned in the
wiki or the book.

Aaron D. Ball adb@broad.mit.edu
Senior Systems Analyst
Broad Institute of MIT and Harvard

All I can really tell you is to search the living hell out of the
mailing lists. I have every list message since I signed up archived
both on my hard drive in gmail. At last check it was somewhere in the
neighborhood of 300 MB.

perldoc on some of the lib/RT/*.pm files may point you in the right
direction, but I’ve never been able to sit through that mess myself.

Aaron D. Ball wrote:

Drew Barnes wrote:

Owner=“CurrentUser” may work if you do an Element (like MyTickets
or MyRequests) to embed on the page

Thanks! That did it. Is there a reference somewhere where I can see
the available substitutions? I didn’t see them mentioned in the
wiki or the book.

Drew Barnes
Applications Analyst
Network Resources Department
Raymond Walters College
University of Cincinnati