Time Based Query

Greetings to all,

Maybe I’m having a rough day, but I can’t seem to get a handle on a time
based query.

My statement …

Status = ‘new’ AND Created < ‘-1 days ago’ AND Created > ‘-3 days
ago’

… shows me all the tickets new created between a day and 3 days ago.
If I change the days to hours, I think I should get all the tickets that
are new between 1 hour and 3 hours ago, but I get nothing.

What am I doing wrong here? Is there some documentation some place that
explains this really well. I checked the wiki and its not real clear
either.

Thanks,

Tom

Status = ‘new’ AND Created < ‘-1 days ago’ AND Created > ‘-3 days
ago’

RT uses Time::ParseDate. The man page does not seem to indicate that you
can use a negative number with ago. Besides, what does that mean?
Doesn’t 1 day ago mean yesterday and -1 day ago mean tomorrow?

Russell Mosemann, Ph.D. * Computing Services * Concordia University, Nebraska
Matthew 8:31-32 - The first mention of deviled ham in the Bible.

Ok, maybe I’m trying to be too specific… Here is exactly what I’m
trying to do and the output that I’m getting …

[rt-user@ns1 etc]$ /opt/rt3/bin/rt-crontool --search RT::Search::FromSQL
–search-arg “LastUpdated < ‘30 mins’ AND Status != ‘resolved’ AND
Status != ‘rejected’” --action RT::Action::RecordComment --template
’Ignored Tickets’

[Wed Apr 6 16:42:31 2005] [error]: error: unexpected end of header

(/opt/rt3/lib/RT/Template_Overlay.pm:366)
[Wed Apr 6 16:42:31 2005] [error]: error: unexpected end of header

(/opt/rt3/lib/RT/Template_Overlay.pm:366)
[Wed Apr 6 16:42:31 2005] [error]: error: unexpected end of header

(/opt/rt3/lib/RT/Template_Overlay.pm:366)
[Wed Apr 6 16:42:31 2005] [error]: error: unexpected end of header

(/opt/rt3/lib/RT/Template_Overlay.pm:366)
[Wed Apr 6 16:42:31 2005] [error]: error: unexpected end of header

(/opt/rt3/lib/RT/Template_Overlay.pm:366)
[Wed Apr 6 16:42:31 2005] [error]: error: unexpected end of header

(/opt/rt3/lib/RT/Template_Overlay.pm:366)

This query/command was taken right from the wiki so I would think that
it should work… Any ideas?On Wed, 2005-04-06 at 12:29, Russell Mosemann wrote:

On Wed, 6 Apr 2005, Thomas Earl wrote:

Status = ‘new’ AND Created < ‘-1 days ago’ AND Created > ‘-3 days
ago’

RT uses Time::ParseDate. The man page does not seem to indicate that you
can use a negative number with ago. Besides, what does that mean?
Doesn’t 1 day ago mean yesterday and -1 day ago mean tomorrow?


Russell Mosemann, Ph.D. * Computing Services * Concordia University, Nebraska
Matthew 8:31-32 - The first mention of deviled ham in the Bible.

[rt-user@ns1 etc]$ /opt/rt3/bin/rt-crontool --search RT::Search::FromSQL
–search-arg “LastUpdated < ‘30 mins’ AND Status != ‘resolved’ AND
Status != ‘rejected’” --action RT::Action::RecordComment --template
’Ignored Tickets’

[Wed Apr 6 16:42:31 2005] [error]: error: unexpected end of header

Do you have a template named ‘Ignored Tickets’?

Russell Mosemann, Ph.D. * Computing Services * Concordia University, Nebraska
"God is real (unless declared integer)."

I found the problem… It was in the template itself, I had a ] instead
of a }.

I need to slow down, damn deadlines…

Thanks for your help and sorry for the false alarm…

TomOn Wed, 2005-04-06 at 13:00, Russell Mosemann wrote:

On Wed, 6 Apr 2005, Thomas Earl wrote:

[rt-user@ns1 etc]$ /opt/rt3/bin/rt-crontool --search RT::Search::FromSQL
–search-arg “LastUpdated < ‘30 mins’ AND Status != ‘resolved’ AND
Status != ‘rejected’” --action RT::Action::RecordComment --template
’Ignored Tickets’

[Wed Apr 6 16:42:31 2005] [error]: error: unexpected end of header

Do you have a template named ‘Ignored Tickets’?


Russell Mosemann, Ph.D. * Computing Services * Concordia University, Nebraska
"God is real (unless declared integer)."

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

++ 06/04/05 12:04 -0400 - Thomas Earl:

Status = ‘new’ AND Created < ‘-1 days ago’ AND Created > ‘-3 days
ago’

… shows me all the tickets new created between a day and 3 days ago.
If I change the days to hours, I think I should get all the tickets that
are new between 1 hour and 3 hours ago, but I get nothing.

I do the same quite regularly, but with a different syntax:

Created < ‘-1 hour’ AND Created > ‘-3 hour’

Note that I have left out “ago” and use “hour” instead at “hours”.


Rejo Zenger rejo@rz.xs4all.nl - http://rejo.zenger.nl - PGP 0x75FC50F3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFCVExpHa9Q5nX8UPMRAs2cAJ0eLsCgEA80YHNxcbOG0JP2OcBiRQCg7440
XQLVsDa+9Lxr6LOZlcHHQCs=
=7+em
-----END PGP SIGNATURE-----