<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'>Ken... I pretty much have this working but I am getting an error in the code of the scrip that you sent me. Here is the scrip as I ahve it on my system:<br>----<br>my $trans = $self->TransactionObj;<br>my $ticket = $self->TicketObj;<br>my $ownerid = 10; # Nobody<br><br>my %org = qw(<br>    ComputerandInformationSvs    34<br>    SEHS            34<br>    );<br><br>my $cf = new RT::CustomField($RT::SystemUser);<br>$cf->LoadByName(Queue => $ticket->QueueObj->id,Name => "Building");<br>return 0 unless $cf->id;<br>my $cfvalue = $ticket->FirstCustomFieldValue('Building'); <br>$cfvalue =~ s/\s+//g;<br><br>my $ownerid = $orgs{$cfvalue};<br><br><br># set new Ticket Owner ID<br><br>$ticket->SetOwner($ownerid);<br><br>return 1;<br><br>-----<br><br>I am getting this error when it runs:<br> Scrip 24 Prepare failed: Global symbol "%orgs" requires explicit package name at (eval 6318) line 16. (/opt/rt3/bin/../lib/RT/Action/UserDefined.pm:64)<br><br>If I remove the 'my $ownerid = $orgs{$cfvalue};' line the error goes away and, of course, the last line does not work. <br><span><br><span name="x"></span>Kurt Engle<br>Network Engineer<br>Eugene 4J Schools<span name="x"></span><br></span><br><hr id="zwchr"><b>From: </b>"Kenneth Crocker" <kfcrocker@lbl.gov><br><b>To: </b>rt-users@lists.bestpractical.com<br><b>Sent: </b>Thursday, December 2, 2010 9:26:59 AM<br><b>Subject: </b>Re: [rt-users] Notify based on CF<br><br>Kurt,<br><br>Sorry, I forgot to change this line:<br><br>my $cfvalue = $ticket->FirstCustomFieldValue('CF Name');<br><br>Kenn<br>LBNL<br><br><br><div class="gmail_quote">On Thu, Dec 2, 2010 at 9:25 AM, Kenneth Crocker <span dir="ltr"><<a href="mailto:kfcrocker@lbl.gov" target="_blank">kfcrocker@lbl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Kurt,<br><br>I agree with Kevin. The following is a simple scrip that sets the Owner based on the value in a Custom Field array:<br>
<br>Name: Set owner on CF<br>Condition:On Create<br>Action:User-defined<br>Template: Blank<br>
Stage: TransactionCreate or TransactionBatch<br><br><br>Custom Action Prep:<br># ------------------------------------------------------------------- #<br># Set ticket owner based on Custom Field<br># KFCrocker  6/01/09<br>

# ------------------------------------------------------------------- #<br># set new ticket owner id value<br><br>my $trans = $self->TransactionObj;<br>my $ticket = $self->TicketObj;<br>my $ownerid = 10; # Nobody<br>

<br>my %orgs = qw(<br>           value1        999<br>           value2        999<br>           value3        999<br>          );<br><br>my $cf = new RT::CustomField($RT::SystemUser);<br>$cf->LoadByName(Queue => $ticket->QueueObj->id,Name => "CF Name");<br>

return 0 unless $cf->id;<br>my $cfvalue = $ticket->FirstCustomFieldValue('CFO-Org');  <br>my $ownerid = $orgs{$cfvalue};<br><br># set new Ticket Owner ID<br><br>$ticket->SetOwner($ownerid);<br><br>return 1;<br>

<br>Custom Action Cleanup:<br>return 1;<br><br>Then follow up by creating a separate notification on Owner change.<br><br>Hope this helps.<br><br>Kenn<br>LBNL<div><div></div><div class="h5"><br><br><div class="gmail_quote">
On Thu, Dec 2, 2010 at 8:00 AM, Kurt Engle <span dir="ltr"><<a href="mailto:engle@4j.lane.edu" target="_blank">engle@4j.lane.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="font-family: Times New Roman; font-size: 12pt; color: rgb(0, 0, 0);"><span>I have </span><span style="font-size: 11pt; color: rgb(31, 73, 125);">RT::Extension::ExtractCustomFieldValues installed and working. I do not have a problem populating the CF of a ticket. What I do need is a way to test that value and then notify an e-mail address based on the CF value. <br>

<br>Basically, I need some help with Perl to accomplish this...<br></span><span><br><span></span>Kurt Engle<br><span></span><br></span><br><hr><b>From: </b>"Josh Narins" <<a href="mailto:jnarins@seniorbridge.com" target="_blank">jnarins@seniorbridge.com</a>><br>

<b>To: </b>"Kurt Engle" <<a href="mailto:engle@4j.lane.edu" target="_blank">engle@4j.lane.edu</a>>, "rt-users" <<a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a>><br>

<b>Sent: </b>Thursday, December 2, 2010 6:26:56 AM<br><b>Subject: </b>RE: [rt-users] Notify based on CF<br><br>




<div><div></div><div>
<div>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Do you want a partial solution, to get started?</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">I installed RT::Extension::ExtractCustomFieldValues and I think
your first step would be to add a Scrip for "On Create" with action
"Extract Custom Field Values" but exactly what you'd need to do then
eludes me. Something like "Create a template where the To: line is based
on the value in the Custom Field"</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">But I'm still pretty new at all this RT stuff.</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<br><br><font face="Verdana" size="2"><b>Josh Narins</b></font><br><br><font face="Verdana" size="1">Director of Application Development<br>SeniorBridge<br>845 Third Ave<br>
7th Floor<br>New York, NY 10022 <br>
Tel: (212) 994-6194 <br>
Fax: (212) 994-4260 <br>
Mobile: 
(917) 488-6248<br><a href="mailto:jnarins@seniorbridge.com" target="_blank">jnarins@seniorbridge.com</a><br><a href="http://www.seniorbridge.com/" target="_blank">seniorbridge.com</a></font><br><br><img alt="SeniorBridge" dfsrc="" align="baseline" border="0" hspace="0"><br>

<br>
<hr style="min-height: 1px;">
<font face="Verdana" size="1"><b>SeniorBridge Statement of 
Confidentiality:</b> The contents of this email message are intended for 
the exclusive use of the addressee(s) and may contain confidential or privileged 
information. Any dissemination, distribution or copying of this email by an 
unintended or mistaken recipient is strictly prohibited. In said event, kindly 
reply to the sender and destroy all entries of this message and any attachments 
from your system. Thank you.</font><div style="border-width: medium medium medium 1.5pt; border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; padding: 0in 0in 0in 4pt;">



<div>

<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;">

<p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;">
<a href="mailto:rt-users-bounces@lists.bestpractical.com" target="_blank">rt-users-bounces@lists.bestpractical.com</a>
[mailto:<a href="mailto:rt-users-bounces@lists.bestpractical.com" target="_blank">rt-users-bounces@lists.bestpractical.com</a>] <b>On Behalf Of </b>Kurt
Engle<br>
<b>Sent:</b> Wednesday, December 01, 2010 7:05 PM<br>
<b>To:</b> rt-users<br>
<b>Subject:</b> [rt-users] Notify based on CF</span></p>

</div>

</div>

<p class="MsoNormal"> </p>

<div>

<p class="MsoNormal" style="margin-bottom: 12pt;"><span style="color: black;">I am
interested in setting up a notification tree based on a Custom Field value.
Basically, I have one Q that accepts tickets from multiple physical locations.
I have a tech at each location. I would like the tech at location X to be
notified when a ticket comes in with the Custom Field  Location=X . When
the CF Location=Y, I want a different tech notified, etc... <br>
<br>
Thanks for any help..<br>
<br>
Kurt Engle</span></p>

</div>

</div>

</div>

</div></div></div></div></blockquote></div><br>
</div></div></blockquote></div><br>
</div></body></html>