[rt-users] scrip not working

Kenneth Crocker KFCrocker at lbl.gov
Tue Sep 4 10:58:53 EDT 2007


To all,


	I need some help with a scrip. I have the following coded:

#
#----------------------------------------------------------------------------
# Custom condition:
#----------------------------------------------------------------------------
#
# Check for ticket status changed to "open"
#
my $trans = $self->TransactionObj;

return ($trans->Type eq "Status" &&
         $trans->NewValue eq "open");

#----------------------------------------------------------------------------
# Custom action preparation code:
#----------------------------------------------------------------------------

# set new Work-Status value

my $ticket = $self->TicketObj;
my $cf_obj = RT::CustomField->new($RT::SystemUser);
my $cf_name = "Work-Status";
my $cf_value = "Estimating Effort";

$cf_obj->LoadByName( Name => $cf_name );
$RT::Logger->debug( "Loaded \$cf_obj->Name = ". $cf_obj->Name() ."\n" );
$cf_obj->AddValueForObject( Object=>$ticket, Content=>$cf_value, );

return 1;

#----------------------------------------------------------------------------
# Custom action cleanup code: None
#----------------------------------------------------------------------------

	When I change the ticket status to "open", nothing happens. I do have a 
notification scrip that produces an E_mail notification based on the 
same user-defined condition and that works. But nothing else is getting 
done. Any ideas as to why? I have another scrip similar to this one 
(different Custom field modified and for only 1 particulat queue) and it 
doesn't work either. Thanks in advance.


Kenn
LBNL



More information about the rt-users mailing list