I have this template for when a ticket is stolen:
To: { my $old_owner = RT::User->new( $self->CurrentUser );
$old_owner->Load( $Transaction->OldValue );
$old_owner->EmailAddress(); }
Subject: Ticket #{ $Ticket->Id() } taken by { $Ticket->OwnerObj->Name()
}
A ticket you owned:
{ $Ticket->Subject() }
has been taken by { $Ticket->OwnerObj->Name()}.
{ $RT::WebURL }Ticket/Display.html?id={ $Ticket->Id }
I've been using it since around RT 4.0.6 & all has been well. I'm
deploying a new 4.0.13 system & copied the Scrip and Template intot he
new system. When someone does a Steal, it works inside of RT but I get
the following error in the logs:
[Thu May 30 20:20:45 2013] [info]:
<[email protected]> #4/148 -
Scrip 12 On Take (/opt/rt4/sbin/../lib/RT/Action/SendEmail.pm:285)
[Thu May 30 20:20:45 2013] [info]:
<[email protected]> sent Bcc:
[email protected]
(/opt/rt4/sbin/../lib/RT/Action/SendEmail.pm:316)
[Thu May 30 20:25:52 2013] [info]: Successful login for
[email protected] from IP-REDACTED
(/opt/rt4/sbin/../lib/RT/Interface/Web.pm:758)
[Thu May 30 20:26:20 2013] [error]: Template parsing error: Can't call
method "CurrentUser" on an undefined value at template line 1.
Stack:
[template:1]
[/opt/rt4/sbin/../lib/RT/Template.pm:479]
[/opt/rt4/sbin/../lib/RT/Template.pm:435]
[/opt/rt4/sbin/../lib/RT/Template.pm:363]
[/opt/rt4/sbin/../lib/RT/Template.pm:343]
[/opt/rt4/sbin/../lib/RT/Action/SendEmail.pm:138]
[/opt/rt4/sbin/../lib/RT/Action/Notify.pm:69]
[/opt/rt4/sbin/../lib/RT/ScripAction.pm:226]
[/opt/rt4/sbin/../lib/RT/Scrip.pm:448]
[/opt/rt4/sbin/../lib/RT/Scrips.pm:234]
[/opt/rt4/sbin/../lib/RT/Transaction.pm:179]
[/opt/rt4/sbin/../lib/RT/Record.pm:1504]
[/opt/rt4/sbin/../lib/RT/Ticket.pm:3051]
[/opt/rt4/sbin/../lib/RT/Ticket.pm:3115]
[/opt/rt4/share/html/Ticket/Display.html:153]
[/opt/rt4/share/html/Ticket/autohandler:66]
[/opt/rt4/sbin/../lib/RT/Interface/Web.pm:635]
[/opt/rt4/sbin/../lib/RT/Interface/Web.pm:335]
[/opt/rt4/share/html/autohandler:53]
(/opt/rt4/sbin/../lib/RT/Template.pm:474)
What happened?
--
RT Training in Seattle, June 19-20: http://bestpractical.com/training