[rt-users] Scrip debugging help
Ruslan Zakirov
ruz at bestpractical.com
Mon Mar 28 15:47:45 EDT 2011
Take a look at NotifyGroup action.
On Mon, Mar 28, 2011 at 10:44 PM, Tyler Harding <tharding at uoregon.edu> wrote:
> 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;
--
Best regards, Ruslan.
More information about the rt-users
mailing list