Kimberly,<br><br>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:<br><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><br>I'll write it for you if you send me an HD Tivo. ;)<br><br>-Todd<br><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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" 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><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" 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.<span class="q"><br> (/usr/lib/rt/RT/Action/UserDefined.pm:81)<br></span></font></span></div><br>
<div dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma" size="2"><b>From:</b> Todd Chapman [mailto:<a href="mailto:todd@chaka.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">todd@chaka.net</a>]
<br><b>Sent:</b> Wednesday, January 30, 2008 11:58 AM<br><b>To:</b> Kimberly
McKinnis<br><b>Cc:</b> <a href="mailto:rt-users@lists.bestpractical.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rt-users@lists.bestpractical.com</a><br><b>Subject:</b> Re:
[rt-users] Scrip for escalating priority based on to address from
header<br></font><br></div><div><span class="e" id="q_117cc59656cb7756_3">
<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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">kmckinnis@tivo.com</a>>
wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<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 href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users</a><br>
<br>Community
help: <a href="http://wiki.bestpractical.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://wiki.bestpractical.com</a><br>Commercial support: <a href="mailto:sales@bestpractical.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">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 href="http://rtbook.bestpractical.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://rtbook.bestpractical.com</a><br></blockquote></div><br></span></div></div>
</blockquote></div><br>