Sadly, I'm not cool enough to get you a free TiVo. Mine wasn't even free :P I have Learning Perl, I'm just floundering and it's all starting to look the same Condition: on create Action: User Defined Templayte: Global template: Blank Stage: TransactionCreate my $to = $self->TicketObj->Transactions->First->Message->First->GetHeader('To'); if ($to =~/[EMAIL PROTECTED]/) { $self->TicketObj->SetPriority(98); } return 1; It doesn't error, but it seems to be ignored entirely. I used 'my', as the global variable was throwing errors about global symbol requiring an explicit package name. Perhaps it's working and not parsing right?
________________________________ From: Todd Chapman [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 30, 2008 12:23 PM To: Kimberly McKinnis Cc: rt-users@lists.bestpractical.com Subject: Re: [rt-users] Scrip for escalating priority based on to address from header Kimberly, I would starting by picking up a copy of Learning Perl. If you don't know basic Perl syntax there is no way you will be able to write RT scrips. Try: if ($to =~ /[EMAIL PROTECTED]/) { { $self->TicketObj->SetPriority(98); } I'll write it for you if you send me an HD Tivo. ;) -Todd On 1/30/08, Kimberly McKinnis <[EMAIL PROTECTED]> wrote: Because I have no idea what I'm doing. Without, I still receive errors: [Wed Jan 30 20:17:14 2008] [error]: Scrip 16 Commit failed: Global symbol "$to" requires explicit package name at (eval 2305) line 1. Global symbol "$Ticket" requires explicit package name at (eval 2305) line 1. syntax error at (eval 2305) line 2, near "if $to " Global symbol "$to" requires explicit package name at (eval 2305) line 2. (/usr/lib/rt/RT/Action/UserDefined.pm:81) ________________________________ From: Todd Chapman [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 30, 2008 11:58 AM To: Kimberly McKinnis Cc: rt-users@lists.bestpractical.com Subject: Re: [rt-users] Scrip for escalating priority based on to address from header Why do you have a package statement? And $Ticket should be $self->TicketObj. On 1/30/08, Kimberly McKinnis <[EMAIL PROTECTED]> wrote: 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 = ('[EMAIL PROTECTED]') { $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 _______________________________________________ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
_______________________________________________ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com