<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3199" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=840481520-30012008><FONT face=Arial
color=#0000ff size=2>Because I have no idea what I'm doing. Without, I still
receive errors:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=840481520-30012008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=840481520-30012008><FONT face=Arial
color=#0000ff size=2>[Wed Jan 30 20:17:14 2008] [error]: Scrip 16 Commit failed:
Global symbol "$to" requires explicit package name at (eval 2305) line
1.<BR>Global symbol "$Ticket" requires explicit package name at (eval 2305) line
1.<BR>syntax error at (eval 2305) line 2, near "if $to "<BR>Global symbol "$to"
requires explicit package name at (eval 2305) line
2.<BR> (/usr/lib/rt/RT/Action/UserDefined.pm:81)<BR></FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Todd Chapman [mailto:todd@chaka.net]
<BR><B>Sent:</B> Wednesday, January 30, 2008 11:58 AM<BR><B>To:</B> Kimberly
McKinnis<BR><B>Cc:</B> rt-users@lists.bestpractical.com<BR><B>Subject:</B> Re:
[rt-users] Scrip for escalating priority based on to address from
header<BR></FONT><BR></DIV>
<DIV></DIV>Why do you have a package statement?<BR><BR>And $Ticket should be
$self->TicketObj.<BR><BR>
<DIV><SPAN class=gmail_quote>On 1/30/08, <B class=gmail_sendername>Kimberly
McKinnis</B> <<A href="mailto:kmckinnis@tivo.com">kmckinnis@tivo.com</A>>
wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<P><FONT face=Arial size=2>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.
</FONT></P>
<P><FONT face=Arial size=2>I've approached this with a user defined scrip in
the server queue:</FONT> </P>
<P><FONT face=Arial size=2>Custom condition: return 1;</FONT> </P>
<P><FONT face=Arial size=2>Custom action prep code: return 1;</FONT> </P>
<P><FONT face=Arial size=2>Custom action cleanup code:</FONT> <BR><FONT
face=Arial size=2> </FONT> <BR><FONT face=Arial size=2>package
RT::User;</FONT> </P>
<P><FONT face=Arial size=2>my $to =
$Ticket->Transactions->First->Message->First->GetHeader('To');</FONT>
<BR><FONT face=Arial size=2>if $to = ('xxx\-alert\@.*\.?tivo\.com')</FONT>
<BR><FONT face=Arial size=2>{</FONT> <BR><FONT face=Arial
size=2>$self->TicketObj->SetPriority(98);</FONT> <BR><FONT face=Arial
size=2>}</FONT> <BR><FONT face=Arial size=2>return 1;</FONT> </P>
<P><FONT face=Arial size=2>When opening a new ticket, I see in rt.log:</FONT>
<BR><FONT face=Arial size=2>[Wed Jan 30 18:56:16 2008] [error]: Scrip 16
Commit failed: Global symbol "$to" requires explicit package name at (eval
2242) line 3.</FONT></P>
<P><FONT face=Arial size=2>Global symbol "$Ticket" requires explicit package
name at (eval 2242) line 3.</FONT> <BR><FONT face=Arial size=2>syntax error at
(eval 2242) line 4, near "if $to "</FONT> <BR><FONT face=Arial size=2>Global
symbol "$to" requires explicit package name at (eval 2242) line 4.</FONT>
<BR><FONT face=Arial
size=2> (/usr/lib/rt/RT/Action/UserDefined.pm:81)</FONT> </P>
<P><FONT face=Arial size=2>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!</FONT></P>
<P><FONT face=Arial size=2>~~</FONT> <BR><FONT face=Arial size=2>Kimberly
McKinnis</FONT> <BR><FONT face=Arial size=2>System Operations Engineer</FONT>
<BR><FONT face=Arial size=2>Service Provider Division, TiVo Inc</FONT>
<BR><FONT face=Arial size=2>408-519-9607</FONT>
</P></DIV><BR>_______________________________________________<BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users"
target=_blank>http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users</A><BR><BR>Community
help: <A onclick="return top.js.OpenExtLink(window,event,this)"
href="http://wiki.bestpractical.com"
target=_blank>http://wiki.bestpractical.com</A><BR>Commercial support: <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:sales@bestpractical.com">sales@bestpractical.com</A><BR><BR><BR>Discover
RT's hidden secrets with RT Essentials from O'Reilly Media.<BR>Buy a copy at
<A onclick="return top.js.OpenExtLink(window,event,this)"
href="http://rtbook.bestpractical.com"
target=_blank>http://rtbook.bestpractical.com</A><BR></BLOCKQUOTE></DIV><BR></BODY></HTML>