[rt-users] Problem with custom Template

Brian Lawson blawson at samhouston.net
Mon Mar 29 11:25:09 EDT 2010


Thanks for pointing that out! All is working now!

-Brian

-----Original Message-----
From: Potla, Ashish Bassaliel [mailto:c_apotla at qualcomm.com] 
Sent: Monday, March 29, 2010 10:11 AM
To: Brian Lawson
Subject: RE: Problem with custom Template

Isnt there supposed to be a 'new' keyword somewhere?
my $old_owner = new RT::User($RT::SystemUser); 
or
my $old_owner = RT::User->new($RT::SystemUser);

________________________________________
From: rt-users-bounces at lists.bestpractical.com
[rt-users-bounces at lists.bestpractical.com] On Behalf Of Brian Lawson
[blawson at samhouston.net]
Sent: Monday, March 29, 2010 8:00 PM
To: rt-users at lists.bestpractical.com
Subject: [rt-users] Problem with custom Template

Still a newbie.  Using RT 3.8.2

I've been playing around with making an OnOwnerChangeNotifyOwner scrip
and I am having parsing errors.

I am using just a NotifyOwner Action with a custom template with the
stage as TransactionCreate.

Here is my template:

To: { my $old_owner = RT::User($RT::SystemUser);
$old_owner->Load( $Transaction->OldValue );
$old_owner->EmailAddress || $Transaction->OldValue}
Subject: [{$rtname} Ticket #{ $Ticket->Id( ) } Owner Change Notification

A ticket that you owned:
   {Subject: $Ticket->Subject()}

is now owned by
   {$Ticket->OwnerObj->Name()}


{$RT->WebURL}Ticket/Display.html?id={$Ticket->Id}

I'm seeing the following error in the rt.log:

[error]: Template parsing error: Undefined subroutine &RT::User called
at template line 1.
Stack:
  [template:1]
  [/opt/rt3/bin/../lib/RT/Template_Overlay.pm:425]
  [/opt/rt3/bin/../lib/RT/Template_Overlay.pm:332]
  [/opt/rt3/bin/../lib/RT/Template_Overlay.pm:312]
  [/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:157]
  [/opt/rt3/bin/../lib/RT/Action/Notify.pm:69]
  [/opt/rt3/bin/../lib/RT/ScripAction_Overlay.pm:230]
  [/opt/rt3/bin/../lib/RT/Scrip_Overlay.pm:435]
  [/opt/rt3/bin/../lib/RT/Scrips_Overlay.pm:240]
  [/opt/rt3/bin/../lib/RT/Transaction_Overlay.pm:169]
  [/opt/rt3/bin/../lib/RT/Record.pm:1456]
  [/opt/rt3/bin/../lib/RT/Ticket_Overlay.pm:2796]
  [/opt/rt3/bin/../lib/RT/Interface/Web.pm:1068]
  [/opt/rt3/share/html/Ticket/ModifyPeople.html:75]
  [/opt/rt3/share/html/autohandler:311]
(/opt/rt3/bin/../lib/RT/Template_Overlay.pm:420)

Please help,
Brian

This communication, together with any attachments hereto or links
contained herein, is for the sole use of the intended recipient(s) and
may contain information that is confidential or legally protected. If
you are not the intended recipient, you are hereby notified that any
review, disclosure, copying, dissemination, distribution or use of this
communication is STRICTLY PROHIBITED. If you have received this
communication in error, please notify the sender immediately by return
e-mail message and delete the original and all copies of the
communication, along with any attachments hereto or links herein, from
your system.


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

This communication, together with any attachments hereto or links contained herein, is for the sole use of the intended recipient(s) and may contain information that is confidential or legally protected. If you are not the intended recipient, you are hereby notified that any review, disclosure, copying, dissemination, distribution or use of this communication is STRICTLY PROHIBITED. If you have received this communication in error, please notify the sender immediately by return e-mail message and delete the original and all copies of the communication, along with any attachments hereto or links herein, from your system.




More information about the rt-users mailing list