[rt-users] Scrip debugging help

Tyler Harding tharding at uoregon.edu
Mon Mar 28 14:44:14 EDT 2011


Hello,

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:

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, 'emailaddress at dns.com';
    @{ $self->{'To'} }  = @To;
    $self->{'Subject'}  = $ticket->OwnerObj->Name();
}

return 1;


cleanup code:

return 1;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110328/63e73ce6/attachment.htm>


More information about the rt-users mailing list