[rt-users] Scrip for escalating priority based on to address from header

Kimberly McKinnis kmckinnis at tivo.com
Wed Jan 30 13:58:19 EST 2008


I've read up on priorities, but nothing I've seen quite fits my need. We
have two email addresses that both go to the same queue, an alert email
and a support email. The alert email also SMS's my mobile phone. I'd
like to have RT check the to: address from the header and set anything
to the alert email to a high priority. Then I can do things like a cron
to check for untouched emails with a high priority and alert us. 

I've approached this with a user defined scrip in the server queue:

Custom condition: return 1;

Custom action prep code: return 1;

Custom action cleanup code:
 
package RT::User;

my $to = $Ticket->Transactions->First->Message->First->GetHeader('To');
if $to = ('xxx\-alert\@.*\.?tivo\.com')
{
$self->TicketObj->SetPriority(98);
}
return 1;

When opening a new ticket, I see in rt.log:
[Wed Jan 30 18:56:16 2008] [error]: Scrip 16 Commit failed: Global
symbol "$to" requires explicit package name at (eval 2242) line 3.
Global symbol "$Ticket" requires explicit package name at (eval 2242)
line 3.
syntax error at (eval 2242) line 4, near "if $to "
Global symbol "$to" requires explicit package name at (eval 2242) line
4.
 (/usr/lib/rt/RT/Action/UserDefined.pm:81)

Obviously, I'm doing something very wrong, but I'm not clear what. Could
someone proofread this and let me know where I've gone wrong? Thanks!

~~
Kimberly McKinnis
System Operations Engineer
Service Provider Division, TiVo Inc
408-519-9607

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20080130/4e67bfe1/attachment.htm>


More information about the rt-users mailing list