<html>
<head>
<style>
.sw_message P{margin:0px;padding:0px;}
.sw_message {FONT-SIZE: 12pt;FONT-FAMILY:Tahoma,Arial,Helvetica,sans-serif;background:white;}
</style>
</head>
<body class="sw_message">
Yeah, I hadn't considered that. But in that case then it shouldn't try to send the email. So it'll need a check for the owner and if the owner is not nobody then send the message. Still, I don't know how to do either of those checks, for the owner and then to ensure it sends an email.<br><br>Any pointers?<br><br><br>Kevin W. Gagel<br>Network Administrator<br>Local 5448<br>My blog:<br>http://mail.cnc.bc.ca/blogs/gagel<br>My shared files:<br>http://mail.cnc.bc.ca/users/gagel<br><br><br>--- Original message --- <br>Subject: Re: [rt-users] Question on custom scrip condition <br>From: Ken Crocker <kfcrocker@lbl.gov> <br>To: Kevin Gagel <gagel@cnc.bc.ca> <br>Cc: <RT-Users@lists.bestpractical.com> <br>Date: 22/06/2009 3:24 PM<br><br> <div>Kevin,<br><br>What if the ticket is created WITHOUT an owner?<br><br>Kenn<br>LBNL<br><br>On 6/22/2009 2:57 PM, Kevin Gagel wrote: <blockquote cite="mid:4a3ffe4b.e08.f00.270@cnc.bc.ca" type="cite"> <style> .sw_message P{margin:0px;padding:0px;} .sw_message {FONT-SIZE: 12pt;FONT-FAMILY:Tahoma,Arial,Helvetica,sans-serif;background:white;} </style>Thanks Ken for the script. I've altered Ken's script to this:<br>my $trans = $self->TransactionObj;<br>my $ticket = $self->TicketObj;<br>if ($trans->Type eq 'CustomField')<br> {my $cf = new RT::CustomField($RT::SystemUser);<br> $cf->LoadByName(Queue => $ticket->QueueObj->id,<br> Name => 'Urgency');<br> return 0 unless $cf->id; <br> if ($trans->Field == $cf->id && $trans->NewValue eq 'URGENT')<br> {<br> $RT::Logger->debug('.');<br> $RT::Logger->debug('It is an URGENT ticket so send the owner a message.');<br> $RT::Logger->debug('.');<br> return 1;<br> }<br> else<br> {<br> $RT::Logger->debug('.');<br> $RT::Logger->debug('Fell through the check and into the else.');<br> $RT::Logger->debug('.');<br> }<br> }<br> <br>return 0;<br>===================================================<br>The debug output shows it is doing what's expected but I am not receiving an email. The debug output indicates that no recipients were found. So... How do I correct that?<br>I want the owner of the ticket to be notified by email if a ticket is created with an URGENT status or if the status changes to URGENT.<br> <br>Actual debug output:<br>[Mon Jun 22 21:51:02 2009] [debug]: Setting deferred recipients for attribute creation (/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:689)<br>[Mon Jun 22 21:51:02 2009] [debug]: Working on mailfield Bcc; recipients are (/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:650)<br>[Mon Jun 22 21:51:02 2009] [debug]: Subject: [Email Issue: #165] URGENT: URGENT <br>From: "Kevin W. Gagel via RT" rt\@XXXXXX.bc.ca<br>Reply-To: rt\@XXXXXX.bc.ca<br>Message-ID: <rt-3.8.2-19683-1245707462-1931.165-12-0@CNC IT Services><br>Precedence: bulk<br>X-RT-Loop-Prevention: CNC's Ticket System<br>RT-Ticket: CNC's Ticket System #165<br>Managed-by: RT 3.8.2 (<a target="_blank" class="moz-txt-link-freetext" href="http://www.bestpractical.com/rt/">http://www.bestpractical.com/rt/</a>)<br>RT-Originator: <a target="_blank" class="moz-txt-link-abbreviated" href="mailto:gagel@XXXXXX.bc.ca">gagel@XXXXXX.bc.ca</a><br>MIME-Version: 1.0<br>Content-Transfer-Encoding: 8bit<br>Content-Type: text/plain; charset="utf-8"<br>X-RT-Original-Encoding: utf-8 (/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:657)<br>[Mon Jun 22 21:51:02 2009] [debug]: Removing deferred recipients from Bcc: line (/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:680)<br>[Mon Jun 22 21:51:02 2009] [debug]: Setting deferred recipients for attribute creation (/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:689)<br>[Mon Jun 22 21:51:02 2009] [debug]: No recipients found for deferred delivery on transaction #2236 (/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:702)<br> <br> <br>Kevin W. Gagel<br>Network Administrator<br>Local 5448<br>My blog:<br><a target="_blank" class="moz-txt-link-freetext" href="http://mail.cnc.bc.ca/blogs/gagel">http://mail.cnc.bc.ca/blogs/gagel</a><br>My shared files:<br><a target="_blank" class="moz-txt-link-freetext" href="http://mail.cnc.bc.ca/users/gagel">http://mail.cnc.bc.ca/users/gagel</a><br> <br> <br>--- Original message --- <br>Subject: Re: [rt-users] Question on custom scrip condition <br>From: Ken Crocker <a target="_blank" class="moz-txt-link-rfc2396E" href="mailto:kfcrocker@lbl.gov"><kfcrocker@lbl.gov></a> <br>To: Kevin Gagel <a target="_blank" class="moz-txt-link-rfc2396E" href="mailto:gagel@cnc.bc.ca"><gagel@cnc.bc.ca></a> <br>Cc: RT Users <a target="_blank" class="moz-txt-link-rfc2396E" href="mailto:RT-Users@lists.bestpractical.com"><RT-Users@lists.bestpractical.com></a> <br>Date: 16/06/2009 3:56 PM<br> <br> <div>Kevin,<br> <br> <br>Here's one we use for when the development step of a ticket (CF "Work-State") is changed to "Review Approved":<br> <br># condition execution on CF Review Process<br> <br>my $trans = $self->TransactionObj;<br>my $ticket = $self->TicketObj;<br> <br>if ($trans->Type eq 'CustomField')<br> {my $cf = new RT::CustomField($RT::SystemUser);<br> $cf->LoadByName(Queue => $ticket->QueueObj->id,<br> Name => "Work-State");<br> return 0 unless $cf->id; <br> if ($trans->Field == $cf->id &&<br> $trans->NewValue eq "Review Complete-Approved")<br> {<br> return 1;<br> }<br> }<br> <br>return 0;<br> <br>Just plug in your CF name and value you want and you're set. Hope this helps.<br> <br>Kenn<br>LBNL<br> <br>On 6/16/2009 2:53 PM, Kevin Gagel wrote: <blockquote cite="mid:4a381448.e44.300.10cb@cnc.bc.ca" type="cite"> <style> .sw_message P{margin:0px;padding:0px;} .sw_message {FONT-SIZE: 12pt;FONT-FAMILY:Tahoma,Arial,Helvetica,sans-serif;background:white;} </style>My users don't want to use priorities so they've had me create 4 levelsfor urgency. They only want to be notified by email on an item that hasthe highest urgency level set. So I want to setup a custom conditionthat tests for that level and then sends an email to the user if thatspecific level is set.<br> <br>So, I have a custom field of "Urgency" which can have a value of URGENT, High, Medium, Low, or Project.<br>I have the template made already for the email to be sent out and thescrip configured for it. I just don't know how to write the customcondition to put into the scrip. How do I write the condition to test for "URGENT" and indicate the action to send the email?<br> <br>All the references I'm finding in the RT Essentials have me a bit confused, am I supposed to right a new module to make this scrip or can I just add the perl code to the condition (not that I know what code I have to enter just yet).<br> <br>Kevin W. Gagel<br>Network Administrator<br>Local 5448<br>My blog:<br> <a moz-do-not-send="true" target="_blank" class="moz-txt-link-freetext" href="http://mail.cnc.bc.ca/blogs/gagel">http://mail.cnc.bc.ca/blogs/gagel</a><br>My shared files:<br> <a moz-do-not-send="true" target="_blank" class="moz-txt-link-freetext" href="http://mail.cnc.bc.ca/users/gagel">http://mail.cnc.bc.ca/users/gagel</a><br> <br> <br> <pre wrap=""> <br><hr width="90%" size="4"> <br>_______________________________________________ <br><a moz-do-not-send="true" target="_blank" class="moz-txt-link-freetext" href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users</a> <br> <br>Community help: <a moz-do-not-send="true" target="_blank" class="moz-txt-link-freetext" href="http://wiki.bestpractical.com">http://wiki.bestpractical.com</a> <br>Commercial support: <a moz-do-not-send="true" target="_blank" class="moz-txt-link-abbreviated" 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 moz-do-not-send="true" target="_blank" class="moz-txt-link-freetext" href="http://rtbook.bestpractical.com">http://rtbook.bestpractical.com</a></pre> </blockquote> </div> <pre wrap=""> <br><hr width="90%" size="4"> <br>_______________________________________________ <br><a target="_blank" class="moz-txt-link-freetext" href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users</a> <br> <br>Community help: <a target="_blank" class="moz-txt-link-freetext" href="http://wiki.bestpractical.com">http://wiki.bestpractical.com</a> <br>Commercial support: <a target="_blank" class="moz-txt-link-abbreviated" 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 target="_blank" class="moz-txt-link-freetext" href="http://rtbook.bestpractical.com">http://rtbook.bestpractical.com</a></pre></blockquote></div>
</body></html>