[rt-users] Matching relative dates in scrips
Nick Kartsioukas
change+lists.rt at nightwind.net
Thu Oct 8 19:14:17 EDT 2009
I'm trying to get a scrip condition to match when the Starts field of a
ticket has a date of today. We want to be able to set tickets as
stalled with a Starts date sometime in the future, and have a cron job
open tickets on the day when they start, and have a scrip notify the
ticket owner.
Cron entry looks like this:
rt-crontool --search RT::Search::FromSQL --search-arg "Status =
'stalled' AND Starts = 'today'" --action RT::Action::SetStatus
--action-arg "open"
Scrip condition looks like this:
my $txn = $self->TransactionObj;
my $starts = $self->TicketObj->StartsObj;
if ( $txn->OldValue eq "stalled" && $txn->NewValue eq "open" && $starts
eq "today" )
{
return 1;
}
else
{
return 0;
}
The date isn't matching though. I'm missing something, I'm just not
sure what (date conversion maybe?)
More information about the rt-users
mailing list