For anyone interested, it seems the correct line is: my $to = $self->TransactionObj->Attachments->First->GetHeader('To');
Everything works as expected now. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kimberly McKinnis Sent: Thursday, January 31, 2008 11:31 AM To: rt-users@lists.bestpractical.com Subject: Re: [rt-users] Scrip for escalating priority based on toaddressfrom header $RT::Logger->debug("To email was: $to"); returns [Thu Jan 31 19:20:07 2008] [debug]: To email was: ((eval 2211):3) Clearly I'm not parsing the header right :( I can only find references to GetHeader in Attachment_Overlay.pm... -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kimberly McKinnis Sent: Thursday, January 31, 2008 11:03 AM To: rt-users@lists.bestpractical.com Subject: Re: [rt-users] Scrip for escalating priority based on to addressfrom header Perfect! I'm running logging in debug mode, but it's not enough... I wanted to know what it thought $to was. Thank you! -----Original Message----- From: Stephen Turner [mailto:[EMAIL PROTECTED] Sent: Thursday, January 31, 2008 8:00 AM To: Kimberly McKinnis Cc: rt-users@lists.bestpractical.com Subject: Re: [rt-users] Scrip for escalating priority based on to address from header At Wednesday 1/30/2008 06:06 PM, Kimberly McKinnis wrote: >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? > Kimberley, A very useful tool is the RT logger. If you put logging statements in your code, they'll show up in the RT log, so you can see if your code is being executed, examine variables etc. The code looks like this: $RT::Logger->debug("I am here"); or $RT::Logger->debug("Ticket number is: " . $self->TicketObj->id ); Steve _______________________________________________ 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 _______________________________________________ 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