[rt-users] ScriptAction Set CustomFieldValue to already have CustomField Value

Ryo O ryo.ogata at gmail.com
Tue Oct 4 02:08:38 EDT 2011

i want to set CustomFieldValue when comment the ticket.

i try to use below pages ScripActions.


it work well when CustomFieldValue is Empty.
However, when CustomFieldValue have Value, it dose not work.

i'm using RT 3.8.8

below ScripActions is using now.

Custom action cleanup code:

my $CFName = 'CustomerStatus';
my $DefaultValue = 'Closed';
my $RecTransaction = 1;

unless( $self->TicketObj->FirstCustomFieldValue( $CFName ) ) {
  my( $st, $msg ) = $self->TicketObj->AddCustomFieldValue(
                                        Field => $CFName,
                                        Value => $DefaultValue,
                                        RecordTransaction => $RecTransaction );
  unless( $st ) {
    $RT::Logger->warning( "Couldn't set $DefaultValue as value for CF
$CFName:". $msg );
    return undef;
return 1;

Does anyone know the way which i want ?

Appreciate the help - Ryo

Ryo Ogata ( ryo.ogata at gmail.com )

More information about the rt-users mailing list