<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:D="DAV:" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Century Gothic";
        panose-1:2 11 5 2 2 2 2 2 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"Preformattato HTML Carattere";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.StileMessaggioDiPostaElettronica17
        {mso-style-type:personal;
        font-family:"Century Gothic","sans-serif";
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.PreformattatoHTMLCarattere
        {mso-style-name:"Preformattato HTML Carattere";
        mso-style-priority:99;
        mso-style-link:"Preformattato HTML";
        font-family:Consolas;
        color:black;}
span.StileMessaggioDiPostaElettronica20
        {mso-style-type:personal-reply;
        font-family:"Century Gothic","sans-serif";
        color:blue;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif";
color:blue'>Hi Ken!<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif";
color:blue'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif";
color:blue'>Yes, the ticket status got changed to "rejected". <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif";
color:blue'>I'll look at the rights, but that same user receives a notification
email if I "take" one of his tickets, so I'm inclined to think the
problem is elsewhere.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif";
color:blue'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif";
color:blue'>Thank you!<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif";
color:blue'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif";
color:blue'>Bye<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif";
color:blue'>Cris<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif";
color:blue'><o:p> </o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=IT style='font-size:10.0pt;font-family:"Segoe UI","sans-serif";
color:windowtext'>Da:</span></b><span lang=IT style='font-size:10.0pt;
font-family:"Segoe UI","sans-serif";color:windowtext'> Ken Crocker
[mailto:kfcrocker@lbl.gov] <br>
<b>Inviato:</b> giovedì 11 giugno 2009 16.41<br>
<b>A:</b> Guadagnino Cristiano<br>
<b>Cc:</b> rt-users@lists.bestpractical.com<br>
<b>Oggetto:</b> Re: [rt-users] Scrip does not send email<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>Guadagnino,<br>
<br>
<br>
    From what I can see, the scrip did TRY to send an Email. So
the action <i>did</i> work. I would look at the privileges for the requestor.
If RT tries to send an Email and the Requestor doesn't have the right to GET
Emails, then RT won't find a recipient. I'm not sure, but I think
"watch" would be a right o look at. There may be others, but look in
that direction. BTW, did the ticket status get changed to "rejected"?
<br>
<br>
Kenn<br>
LBNL<br>
<br>
On 6/11/2009 1:44 AM, Guadagnino Cristiano wrote: <o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>Hi
all,</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>I am
having a problem with a scrip that does not send emails as expected.</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'> </span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>I
have a queue with a mandatory custom field. If a user tries to create a ticket
in that queue from the RT interface without populating the cf, RT will
complain. However, if a user creates the ticket by sending an email RT will
happily create it.</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'> </span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>So I
created a scrip on that queue that checks if a mandatory cf is present, and if
it is - and it is not populated - it will put the ticket in status
"rejected". </span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'> </span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>Settings
are:</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'> </span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>Condition:
User Defined</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>Action:
Notify Requestors</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>Template:
Global template: Error: no mandatory CF</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>Stage:
TransactionBatch</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>Custom
Condition:</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>my
$trans = $self->TransactionObj;</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>return
0 unless $trans->Type eq "Create";</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'> </span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>my
$ticket = $self->TicketObj;</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'> </span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>my
$CustomFields = $ticket->QueueObj->TicketCustomFields();</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>while
(my $CustomField = $CustomFields->Next()) {</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>   
my $nam = $CustomField->Name;</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>   
my $typ = $CustomField->Type;</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>   
my $vad = $CustomField->Pattern;</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'> </span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>   
$RT::Logger->info( ">  CustomField: $nam \n" );</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>   
$RT::Logger->info( ">  CustomField: $typ \n" );</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>   
$RT::Logger->info( ">  CustomField: $vad \n" );</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'> </span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>   
if ($vad = '(?#Mandatory)') {</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>       
my $val = $ticket->FirstCustomFieldValue($nam);</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>       
if ($val ne '') {</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>           
return 0;</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>       
} else {</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>           
$ticket->SetStatus("rejected");</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>       
}</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>   
}</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>}</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'> </span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New"'>return
1;</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'> </span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>The
scrip works as expected, but it will not send the email to the requestor. In
the log I see this:</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'> </span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Courier New"'>49587 - Scrip 28
OnCreateCheckCF (/opt/rtschedu/bin/../lib/RT/Action/SendEmail.pm:302)</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Courier New"'>[Thu Jun 11 07:53:27
2009] [info]: <a
href="mailto:rt-3.8.4-8458-1244706807-1237.3505-28-0@BankadatiS.I."><rt-3.8.4-8458-1244706807-1237.3505-28-0@Bankadati
S.I.></a> No recipients found. Not sending.
(/opt/rtschedu/bin/../lib/RT/Interface/Email.pm:338)</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'> </span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>I
can not understand why it is saying "No recipients found". Any ideas?</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'> </span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>TIA</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>Bye</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'>Cris</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Century Gothic","sans-serif"'> </span><o:p></o:p></p>

<pre><o:p> </o:p></pre><pre style='text-align:center'>

<hr size=4 width="90%" align=center>

</pre><pre><o:p> </o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre><a
href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users</a><o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Community help: <a
href="http://wiki.bestpractical.com">http://wiki.bestpractical.com</a><o:p></o:p></pre><pre>Commercial support: <a
href="mailto:sales@bestpractical.com">sales@bestpractical.com</a><o:p></o:p></pre><pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre>Discover RT's hidden secrets with RT Essentials from O'Reilly Media. <o:p></o:p></pre><pre>Buy a copy at <a
href="http://rtbook.bestpractical.com">http://rtbook.bestpractical.com</a><o:p></o:p></pre></div>

</body>

</html>