<HTML>
<HEAD>
<TITLE>Scrip debugging help</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hello,<BR>
<BR>
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:<BR>
<BR>
</SPAN></FONT><FONT COLOR="#131313"><FONT SIZE="1"><FONT FACE="Lucida Grande"><SPAN STYLE='font-size:8.5pt'>Can't call method "head" on an undefined value at /usr/local/lib/rt3/lib/RT/Action/SendEmail.pm line 278.<BR>
<BR>
</SPAN></FONT></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>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...<BR>
<BR>
-Why does this error happen when clicking Reply?<BR>
-Why does it apply to other queues?<BR>
-Can I fix it without disabling/deleting my scrip?<BR>
<BR>
Scrip pasted below, thanks for any advice.<BR>
<BR>
-Tyler<BR>
<BR>
<BR>
<BR>
<BR>
Condition: on resolve<BR>
Action: user defined<BR>
Template: transaction<BR>
Stage: transaction batch<BR>
<BR>
prep code:<BR>
<BR>
require RT::Action::SendEmail;<BR>
use strict;<BR>
use vars qw/@ISA/;<BR>
@ISA = qw(RT::Action::SendEmail);<BR>
$self->setUpEmail();<BR>
$self->SUPER::Prepare();<BR>
$self->SUPER::Commit();<BR>
<BR>
sub setUpEmail {<BR>
my $self = shift;<BR>
my $ticket = $self->TicketObj;<BR>
<BR>
push @To, <a href="'emailaddress@dns.com">'emailaddress@dns.com</a>';<BR>
@{ $self->{'To'} } = @To;<BR>
$self->{'Subject'} = $ticket->OwnerObj->Name();<BR>
}<BR>
<BR>
return 1;<BR>
<BR>
<BR>
cleanup code:<BR>
<BR>
return 1;</SPAN></FONT>
</BODY>
</HTML>