[rt-users] Custom Condition based on Transaction Custom Field value

Stephen Turner sturner at MIT.EDU
Wed Mar 9 10:32:17 EST 2005


At Wednesday 3/9/2005 10:17 AM, MP wrote:
>Stephen Turner írta:
>
>In my mind it means that the first call for 
>$self->TransactionObj->$CustomFieldValues->Next returns undef as it would 
>no Transaction CF be there. Is it so?

Yes (I think!). In other words there are no values for the CF.

>I made a small script, but it gives an error... :( Should i initialize 
>something? (self destruct maybe? :))
>
>#!/usr/bin/perl -I/opt/rt3/lib
>use RT;
>RT::LoadConfig;
>RT::Init;
>my $u = RT::User->new($RT::SystemUser);
>$u->Load("root");
>my $t = RT::Ticket->new($u);
>$t->Load("98");
>my $trs = $t->Transactions;
>
>Mar  9 00:11:46 linux RT:  at /opt/rt3/lib/RT/Ticket_Overlay.pm line 
>3564      RT::Ticket::HasRight('RT::Ticket=HASH(0x8ec30d4)', 'Principal', 
>0, 'No object mapping for field', 'Right', 'ShowTicket') called at 
>/opt/rt3/lib/RT/Ticket_Overlay.pm line 3532
>RT::Ticket::CurrentUserHasRight('RT::Ticket=HASH(0x8ec30d4)', 
>'ShowTicket') called at /opt/rt3/lib/RT/Ticket_Overlay.pm line 
>3595       RT::Ticket::Transactions('RT::Ticket=HASH(0x8ec30d4)') called 
>at ./rtx line 9  (/opt/rt3/lib/RT.pm:277)
>Mar  9 00:11:46 linux RT: Principal attrib undefined for Ticket::HasRight 
>(/opt/rt3/lib/RT/Ticket_Overlay.pm:3565)
>

Try passing $RT::SystemUser (instead of $u ) to  RT::Ticket->new.

Steve 




More information about the rt-users mailing list