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.> 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: sa...@bestpractical.com


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: sa...@bestpractical.com


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

Reply via email to