Hi Ken!

Yes, the ticket status got changed to "rejected".
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.

Thank you!

Bye
Cris

Da: Ken Crocker [mailto:[email protected]]
Inviato: giovedì 11 giugno 2009 16.41
A: Guadagnino Cristiano
Cc: [email protected]
Oggetto: Re: [rt-users] Scrip does not send email

Guadagnino,


    From what I can see, the scrip did TRY to send an Email. So the action did 
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"?

Kenn
LBNL

On 6/11/2009 1:44 AM, Guadagnino Cristiano wrote:
Hi all,
I am having a problem with a scrip that does not send emails as expected.

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.

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".

Settings are:

Condition: User Defined
Action: Notify Requestors
Template: Global template: Error: no mandatory CF
Stage: TransactionBatch
Custom Condition:
my $trans = $self->TransactionObj;
return 0 unless $trans->Type eq "Create";

my $ticket = $self->TicketObj;

my $CustomFields = $ticket->QueueObj->TicketCustomFields();
while (my $CustomField = $CustomFields->Next()) {
    my $nam = $CustomField->Name;
    my $typ = $CustomField->Type;
    my $vad = $CustomField->Pattern;

    $RT::Logger->info( ">  CustomField: $nam \n" );
    $RT::Logger->info( ">  CustomField: $typ \n" );
    $RT::Logger->info( ">  CustomField: $vad \n" );

    if ($vad = '(?#Mandatory)') {
        my $val = $ticket->FirstCustomFieldValue($nam);
        if ($val ne '') {
            return 0;
        } else {
            $ticket->SetStatus("rejected");
        }
    }
}

return 1;

The scrip works as expected, but it will not send the email to the requestor. 
In the log I see this:

49587 - Scrip 28 OnCreateCheckCF 
(/opt/rtschedu/bin/../lib/RT/Action/SendEmail.pm:302)
[Thu Jun 11 07:53:27 2009] [info]: 
<rt-3.8.4-8458-1244706807-1237.3505-2...@bankadati 
S.I.><mailto:[email protected].> No 
recipients found. Not sending. 
(/opt/rtschedu/bin/../lib/RT/Interface/Email.pm:338)

I can not understand why it is saying "No recipients found". Any ideas?

TIA
Bye
Cris







________________________________






_______________________________________________

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users



Community help: http://wiki.bestpractical.com

Commercial support: [email protected]<mailto:[email protected]>





Discover RT's hidden secrets with RT Essentials from O'Reilly Media.

Buy a copy at http://rtbook.bestpractical.com
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [email protected]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Reply via email to