[rt-users] Scrip debugging help

Kevin Falcone falcone at bestpractical.com
Mon Mar 28 14:59:56 EDT 2011


On Mon, Mar 28, 2011 at 11:44:14AM -0700, Tyler Harding wrote:
>    I'm trying to use a custom scrip that sends an outgoing email to a specified email address
>    when a ticket gets resolved. After much trudging through archived emails on this list, I was
>    able to accomplish that. But now, sometimes when you click "Reply" there is the following
>    error:

What isn't that just 

Condition: on resolve
Action: notify other recipients
Template: custom template with a hardcoded To:

The code you've sent as a sample has little chance of ever working,
and it totally breaks the encapsulation of running in Preview mode,
which is how you broke Reply.

-kevin

>    Can't call method "head" on an undefined value at
>    /usr/local/lib/rt3/lib/RT/Action/SendEmail.pm line 278.
> 
>    What's more, is my coworker got that error message in a totally different queue. (I was hoping
>    worst case scenario I'd only mess up my own queue's workflow, but that appears to be false.)
>    So I was hoping someone could shed some light...
> 
>    -Why does this error happen when clicking Reply?
>    -Why does it apply to other queues?
>    -Can I fix it without disabling/deleting my scrip?
> 
>    Scrip pasted below, thanks for any advice.
> 
>    -Tyler
> 
>    Condition: on resolve
>    Action: user defined
>    Template: transaction
>    Stage: transaction batch
> 
>    prep code:
> 
>    require RT::Action::SendEmail;
>    use strict;
>    use vars qw/@ISA/;
>    @ISA = qw(RT::Action::SendEmail);
>    $self->setUpEmail();
>    $self->SUPER::Prepare();
>    $self->SUPER::Commit();
> 
>    sub setUpEmail {
>        my $self = shift;
>        my $ticket = $self->TicketObj;
> 
>        push @To, [1]'emailaddress at dns.com';
>        @{ $self->{'To'} }  = @To;
>        $self->{'Subject'}  = $ticket->OwnerObj->Name();
>    }
> 
>    return 1;
> 
>    cleanup code:
> 
>    return 1;
> 
> References
> 
>    Visible links
>    1. file:///Users/falcone/tmp/'emailaddress at dns.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110328/2844cab1/attachment.sig>


More information about the rt-users mailing list