Paul,<br><br>Perhaps I misunderstood. Are you wanting to meet these conditions at the same time (ie. a create with a CF) or are these to be two separate conditions exclusive of each other?<br><br>Kenn<br>LBNL<br><br><div class="gmail_quote">
On Wed, Jun 9, 2010 at 3:37 PM, Dougherty Paul <span dir="ltr"><<a href="mailto:paul_dougherty@prn.com">paul_dougherty@prn.com</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 link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Hi
Keith,</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">These
did not help…I have gotten closer to the error, however.</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">It
seems rather stupid, all I am trying to do is to get the condition to ring true
in my scrip.</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">This
is what I have.</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New";">($self->TicketObj->FirstCustomFieldValue('Urgency')
eq "Critical");</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New";"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New";"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New";">There
are no errors generated by this scrip…but it doesn’t add the watchers…(this
part works when the above condition is met). For example, if I simply use this…</span>($self->TransactionObj->Type
eq "Create"); in the condition, the scrip adds the watchers. </p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New";"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New";">Watcher
add code:</span></p><div class="im">
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">$self->TicketObj->AddWatcher(
Type => "Cc", </span></p>
</div><p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
Email =>"paul_dougherty\@<a href="http://prn.com" target="_blank">prn.com</a>"); </span></p><div class="im">
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">push(
@{$self->{'To'}}, </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
$self->TicketObj->Requestors->MemberEmailAddresses, </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
$self->TicketObj->QueueObj->Cc->MemberEmailAddresses ); </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">return
1;</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
</div><p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Any
ideas?</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Thanks,</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><br>
Paul</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<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;"> Kenneth Crocker
[mailto:<a href="mailto:kfcrocker@lbl.gov" target="_blank">kfcrocker@lbl.gov</a>] <br>
<b>Sent:</b> Thursday, June 03, 2010 9:00 AM<br>
<b>To:</b> Dougherty Paul<div><div></div><div class="h5"><br>
<b>Subject:</b> Re: [rt-users] Scrip help please.</div></div></span></p>
</div><div><div></div><div class="h5">
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="margin-bottom: 12pt;">Paul,<br>
<br>
I have attached two txt files that have the code in them. These files have
flower box comments and such that I always use to maintain my code. have fun
with them.<br>
<br>
Kenn<br>
LBNL</p>
<div>
<p class="MsoNormal">On Thu, Jun 3, 2010 at 8:27 AM, Dougherty Paul <<a href="mailto:paul_dougherty@prn.com" target="_blank">paul_dougherty@prn.com</a>> wrote:</p>
<div>
<div>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Hi Ken,</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Sure, I might be able to use those.</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Thanks,</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Paul</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<div style="border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0in 0in; border-color: -moz-use-text-color;">
<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>Kenneth
Crocker<br>
<b>Sent:</b> Wednesday, June 02, 2010 5:07 PM<br>
<b>To:</b> <a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a><br>
<b>Subject:</b> Re: [rt-users] Scrip help please.</span></p>
</div>
<div>
<div>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="margin-bottom: 12pt;">Paul,<br>
<br>
I have some code that adds a CC to an individual ticket on a Queue basis. So,
if you want this for just certain types of tickets, maybe you could modify it
for those conditions and put it in the Queues relevant to that need. OH, I also
have some code that add's <i>additional</i> Cc's on "Correspondence"
with those tickets as well. Is that something you might be interested in using?<br>
<br>
Kenn<br>
LBNL</p>
<div>
<p class="MsoNormal">On
Wed, Jun 2, 2010 at 2:50 PM, Dougherty Paul <<a href="mailto:paul_dougherty@prn.com" target="_blank">paul_dougherty@prn.com</a>>
wrote:</p>
<div>
<div>
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I
am sure this is an id10t error, but I am trying to write a scrip that sends an
adds a “CC” to a new ticket whose urgency is Critical (or critical). So far,
the closest I have gotten is to have the system add the “CC”’s for every new
ticket.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Here
is the custom condition that is giving me the fits. The current error I am
receiving involves a syntax error…thing is, no matter what I try, I cannot get
this thing to work. Every other part of this process works (ie, when the cc’s
are added, the email is sent. The custom action does indeed add the cc’s).</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I
just need to meet three conditions. One is on create, the other is Urgency
(custom field) Critical or Urgency critical.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks,</p>
<p class="MsoNormal"><br>
Paul</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Custom
condition:</p>
<p class="MsoNormal">if
( ($self->TransactionObj->Type eq "Create") &&</p>
<p class="MsoNormal">
( ( $self->TicketObj->FirstCustomFieldValue('Urgency') eq
"Critical") || ( $self->TicketObj->FirstCustomFieldValue('Urgency')
eq "critical")))</p>
<p class="MsoNormal">return
1;</p>
<p class="MsoNormal">else
</p>
<p class="MsoNormal">return
0;</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Custom
action: (runs fine):</p>
<p class="MsoNormal">$self->TicketObj->AddWatcher(
Type => "Cc", </p>
<p class="MsoNormal">
Email =>"xxx\@<a href="http://prn.com" target="_blank">prn.com</a>");
</p>
<p class="MsoNormal">$self->TicketObj->AddWatcher(
Type => "Cc", </p>
<p class="MsoNormal">
Email =>"xxx\@<a href="http://prn.com" target="_blank">prn.com</a>");
</p>
<p class="MsoNormal">push(
@{$self->{'To'}}, </p>
<p class="MsoNormal">
$self->TicketObj->Requestors->MemberEmailAddresses, </p>
<p class="MsoNormal">
$self->TicketObj->QueueObj->Cc->MemberEmailAddresses ); </p>
<p class="MsoNormal">return
1;</p>
</div>
</div>
<p class="MsoNormal"><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">http://rtbook.bestpractical.com</a></p>
</div>
<p class="MsoNormal"> </p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"> </p>
</div></div></div>
</div>
</blockquote></div><br>