[Rt-devel] Re: [rt-users] Your ticket was stolen in RT 3.4.5
Andy Moran
andy at wildbrain.com
Mon Feb 13 13:10:32 EST 2006
I'm adding rt-devel to this since I didn't get any response on
rt-users. Also, I found an error so I think it has to do with the
$self->CurrentUser bit. Here is the error I'm getting in /var/log/messages:
Feb 13 10:02:00 constantinople RT: error: unexpected end of header
(/usr/local/rt3/lib/RT/Template_Overlay.pm:369)
Feb 13 10:02:00 constantinople RT: Template parsing error: Can't call
method "CurrentUser" on an undefined value at template line 1. Stack:
[template:1] [/usr/local/rt3/lib/RT/Template_Overlay.pm:419]
[/usr/local/rt3/lib/RT/Template_Overlay.pm:343]
[/usr/local/rt3/lib/RT/Action/SendEmail.pm:112]
[/usr/local/rt3/lib/RT/Action/Notify.pm:65]
[/usr/local/rt3/lib/RT/ScripAction_Overlay.pm:233]
[/usr/local/rt3/lib/RT/Scrip_Overlay.pm:478]
[/usr/local/rt3/lib/RT/Scrips_Overlay.pm:236]
[/usr/local/rt3/lib/RT/Transaction_Overlay.pm:162]
[/usr/local/rt3/lib/RT/Record.pm:1438]
[/usr/local/rt3/lib/RT/Ticket_Overlay.pm:3021]
[/usr/local/rt3/lib/RT/Ticket_Overlay.pm:3086]
[/usr/local/rt3/local/html/Ticket/Display.html:125]
[/usr/local/rt3/share/html/autohandler:215]
(/usr/local/rt3/lib/RT/Template_Overlay.pm:415)
Feb 13 10:02:00 constantinople RT: error: unexpected end of header
(/usr/local/rt3/lib/RT/Template_Overlay.pm:369)
I double checked with RT Essentials and the Template looks right. Is
there an error in the RT Essentials code? What should it say instead of:
my $old_owner = RT::User->new( $self->CurrentUser );
I think that's the line it's dying on. Any help would be appreciated!
Thanks.
--Andy
Andy Moran wrote:
> I'm trying to figure out why the "Your Ticket was Stolen" custom scrip
> isn't working for me. I'm using the example from the RT Essentials
> book using RT 3.4.5.
>
> The scrip uses Condition: User Defined, Action: Notify Other Recipients,
> Template: Custom Stolen Ticket
>
> Here is the custom condition:
>
> my $trans = $self->TransactionObj;
> return 0 unless $trans->Field eq 'Owner';
> return 1 if $trans->OldValue != RT::Nobody()->id();
> return 0;
>
>
> Here is the template:
>
> 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 }
>
>
>
> Has the API changed since hte book was published? Do I have a typo
> somewhere I cannot see? There doesn't seem to be any complaints, just
> no email gets sent out. Any help would be appreciated!
>
> --Andy
>
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com
>
> Download a free sample chapter of RT Essentials from O'Reilly Media at http://rtbook.bestpractical.com
>
> WE'RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
> San Francisco - Find out more at http://bestpractical.com/services/training.html
>
More information about the Rt-devel
mailing list