[rt-users] Error with custom scrip action
Oluwatomisin Ilori
tomisilori at yahoo.co.uk
Thu Feb 24 05:22:50 EST 2005
Hi everyone,
I'm running rt 3.4.0 on apache 1.3 with mod_perl 1, perl 5.8.4, mysql 4.19. I'm trying to create a custom scrip action to add adminCc's to a ticket based on the custom field selection and a change of owner.
The scrip i'm using is given below.
Scrip condition: On owner change
scrip action: user defined
template:global template blank
custom action preparation code: return 1;
custom action cleanup code:
my $Ticket= RT::Ticket->new ($RT::SystemUser);
my $admincclist = $Ticket->AdminCc;
my $cfValue = $Ticket->FirstCustomFieldValue('Region');
if ($cfValue =~/Region East/i && $self->TransactionObj->Type eq "Set" && $self->TransactionObj->Field eq "Owner")
{
$user->LoadByEmail('browna at tosoft.com');
$admincclist->AddMember($user->Id);
}
elsif ($cfValue =~/Region West/i && $self->TransactionObj->Type eq "Set" && $self->TransactionObj->Field eq "Owner")
{
$user->LoadByEmail('charlesd at tosoft.com');
$admincclist->AddMember($user->Id);
}
elsif ($cfValue =~/Region North/i && $self->TransactionObj->Type eq "Set" && $self->TransactionObj->Field eq "Owner")
{
$user->LoadByEmail('tolu at tosoft.com');
$admincclist->AddMember($user->Id);
}
else
{
return 0;
}
But i get the following error in the log. Pls, can someone help me out. Thanks.
(/opt/rt3/lib/RT/Template_Overlay.pm:366)
[Thu Feb 24 14:35:15 2005] [error]: Template parsing error: Can't call method "TicketObj" on an undefined value at template line 8.
Stack:
[template:8]
[/opt/rt3/lib/RT/Template_Overlay.pm:416]
[/opt/rt3/lib/RT/Template_Overlay.pm:340]
[/opt/rt3/lib/RT/Action/SendEmail.pm:112]
[/opt/rt3/lib/RT/Action/Notify.pm:65]
[/opt/rt3/lib/RT/ScripAction_Overlay.pm:220]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:477]
[/opt/rt3/lib/RT/Scrips_Overlay.pm:235]
[/opt/rt3/lib/RT/Transaction_Overlay.pm:160]
[/opt/rt3/lib/RT/Record.pm:1373]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:2997]
[/opt/rt3/lib/RT/Interface/Web.pm:1063]
[/opt/rt3/share/html/Ticket/Display.html:140]
[/opt/rt3/share/html/Ticket/Update.html:211]
[/opt/rt3/share/html/autohandler:215]
(/opt/rt3/lib/RT/Template_Overlay.pm:412)
[Thu Feb 24 14:35:15 2005] [error]: error: unexpected end of header
(/opt/rt3/lib/RT/Template_Overlay.pm:366)
[Thu Feb 24 14:35:15 2005] [debug]: About to commit scrips for transaction #2044 (/opt/rt3/lib/RT/Transaction_Overlay.pm:167)
[Thu Feb 24 14:35:15 2005] [crit]: RT::Principal=HASH(0x9d3b6f0) HasRight called with no valid object (/opt/rt3/lib/RT/Principal_Overlay.pm:293)
root at 0[log]# tail --lines=100 rt.log
(/opt/rt3/lib/RT/Template_Overlay.pm:366)
[Thu Feb 24 14:35:13 2005] [debug]: About to think about scrips for transaction #2043 (/opt/rt3/lib/RT/Transaction_Overlay.pm:154)
[Thu Feb 24 14:35:13 2005] [debug]: About to prepare scrips for transaction #2043 (/opt/rt3/lib/RT/Transaction_Overlay.pm:158)
[Thu Feb 24 14:35:13 2005] [debug]: Found 3 scrips (/opt/rt3/lib/RT/Scrips_Overlay.pm:354)
[Thu Feb 24 14:35:14 2005] [error]: Template parsing error: Can't call method "TicketObj" on an undefined value at template line 8.
Stack:
[template:8]
[/opt/rt3/lib/RT/Template_Overlay.pm:416]
[/opt/rt3/lib/RT/Template_Overlay.pm:340]
[/opt/rt3/lib/RT/Action/SendEmail.pm:112]
[/opt/rt3/lib/RT/Action/Notify.pm:65]
[/opt/rt3/lib/RT/ScripAction_Overlay.pm:220]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:477]
[/opt/rt3/lib/RT/Scrips_Overlay.pm:235]
[/opt/rt3/lib/RT/Transaction_Overlay.pm:160]
[/opt/rt3/lib/RT/Record.pm:1373]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:2369]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:2302]
[/opt/rt3/lib/RT/Interface/Web.pm:478]
[/opt/rt3/share/html/Ticket/Display.html:134]
[/opt/rt3/share/html/Ticket/Update.html:211]
[/opt/rt3/share/html/autohandler:215]
(/opt/rt3/lib/RT/Template_Overlay.pm:412)
[Thu Feb 24 14:35:14 2005] [error]: error: unexpected end of header
(/opt/rt3/lib/RT/Template_Overlay.pm:366)
[Thu Feb 24 14:35:14 2005] [error]: Template parsing error: Can't call method "TicketObj" on an undefined value at template line 8.
Stack:
[template:8]
[/opt/rt3/lib/RT/Template_Overlay.pm:416]
[/opt/rt3/lib/RT/Template_Overlay.pm:340]
[/opt/rt3/lib/RT/Action/SendEmail.pm:112]
[/opt/rt3/lib/RT/Action/Notify.pm:65]
[/opt/rt3/lib/RT/ScripAction_Overlay.pm:220]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:477]
[/opt/rt3/lib/RT/Scrips_Overlay.pm:235]
[/opt/rt3/lib/RT/Transaction_Overlay.pm:160]
[/opt/rt3/lib/RT/Record.pm:1373]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:2369]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:2302]
[/opt/rt3/lib/RT/Interface/Web.pm:478]
[/opt/rt3/share/html/Ticket/Display.html:134]
[/opt/rt3/share/html/Ticket/Update.html:211]
[/opt/rt3/share/html/autohandler:215]
(/opt/rt3/lib/RT/Template_Overlay.pm:412)
[Thu Feb 24 14:35:14 2005] [error]: error: unexpected end of header
(/opt/rt3/lib/RT/Template_Overlay.pm:366)
[Thu Feb 24 14:35:14 2005] [debug]: About to commit scrips for transaction #2043 (/opt/rt3/lib/RT/Transaction_Overlay.pm:167)
[Thu Feb 24 14:35:14 2005] [debug]: About to think about scrips for transaction #2044 (/opt/rt3/lib/RT/Transaction_Overlay.pm:154)
[Thu Feb 24 14:35:15 2005] [debug]: About to prepare scrips for transaction #2044 (/opt/rt3/lib/RT/Transaction_Overlay.pm:158)
[Thu Feb 24 14:35:15 2005] [debug]: Found 3 scrips (/opt/rt3/lib/RT/Scrips_Overlay.pm:354)
[Thu Feb 24 14:35:15 2005] [error]: Template parsing error: Can't call method "TicketObj" on an undefined value at template line 8.
Stack:
[template:8]
[/opt/rt3/lib/RT/Template_Overlay.pm:416]
[/opt/rt3/lib/RT/Template_Overlay.pm:340]
[/opt/rt3/lib/RT/Action/SendEmail.pm:112]
[/opt/rt3/lib/RT/Action/Notify.pm:65]
[/opt/rt3/lib/RT/ScripAction_Overlay.pm:220]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:477]
[/opt/rt3/lib/RT/Scrips_Overlay.pm:235]
[/opt/rt3/lib/RT/Transaction_Overlay.pm:160]
[/opt/rt3/lib/RT/Record.pm:1373]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:2997]
[/opt/rt3/lib/RT/Interface/Web.pm:1063]
[/opt/rt3/share/html/Ticket/Display.html:140]
[/opt/rt3/share/html/Ticket/Update.html:211]
[/opt/rt3/share/html/autohandler:215]
(/opt/rt3/lib/RT/Template_Overlay.pm:412)
[Thu Feb 24 14:35:15 2005] [error]: error: unexpected end of header
(/opt/rt3/lib/RT/Template_Overlay.pm:366)
[Thu Feb 24 14:35:15 2005] [error]: Template parsing error: Can't call method "TicketObj" on an undefined value at template line 8.
Stack:
[template:8]
[/opt/rt3/lib/RT/Template_Overlay.pm:416]
[/opt/rt3/lib/RT/Template_Overlay.pm:340]
[/opt/rt3/lib/RT/Action/SendEmail.pm:112]
[/opt/rt3/lib/RT/Action/Notify.pm:65]
[/opt/rt3/lib/RT/ScripAction_Overlay.pm:220]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:477]
[/opt/rt3/lib/RT/Scrips_Overlay.pm:235]
[/opt/rt3/lib/RT/Transaction_Overlay.pm:160]
[/opt/rt3/lib/RT/Record.pm:1373]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:2997]
[/opt/rt3/lib/RT/Interface/Web.pm:1063]
[/opt/rt3/share/html/Ticket/Display.html:140]
[/opt/rt3/share/html/Ticket/Update.html:211]
[/opt/rt3/share/html/autohandler:215]
(/opt/rt3/lib/RT/Template_Overlay.pm:412)
[Thu Feb 24 14:35:15 2005] [error]: error: unexpected end of header
(/opt/rt3/lib/RT/Template_Overlay.pm:366)
[Thu Feb 24 14:35:15 2005] [debug]: About to commit scrips for transaction #2044 (/opt/rt3/lib/RT/Transaction_Overlay.pm:167)
[Thu Feb 24 14:35:15 2005] [crit]: RT::Principal=HASH(0x9d3b6f0) HasRight called with no valid object (/opt/rt3/lib/RT/Principal_Overlay.pm:293)
---------------------------------
ALL-NEW Yahoo! Messenger - all new features - even more fun!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20050224/e7034c8f/attachment.htm>
More information about the rt-users
mailing list