[rt-users] Get Value of Custom Field in Custom Action

Sam Chenkin schenkin at gmail.com
Tue Feb 3 00:00:36 EST 2009


Hello all,

I am trying to write a custom action that pulls a custom value from a
user and changes the new ticket's priority based on that value.

Below is the code I've written so far. It does successfully pull
values (The ->Count method returns the correct number of values), but
I can't GET the values out. ->Next just returns an empty variable. Any
ideas?

Thanks,
~Sam

my $currentTicket = $self->TicketObj;

my $currentUser = new RT::CurrentUser;
$currentUser->LoadByEmail( $currentTicket->RequestorAddresses() );

$RT::Logger->debug("I found the user: " . $currentUser->Name);

my $CF_Obj = RT::CustomField->new($RT::SystemUser);
$CF_Obj->Load( '3' );

$RT::Logger->debug("Name of found CF Object is: " . $CF_Obj->Name() .
" Created on " . $CF_Obj->Created);

my $startPriority = ($CF_Obj->ValuesForObject( $currentUser ));
$RT::Logger->debug( "There are " . $startPriority->Count . " objects");



More information about the rt-users mailing list