[rt-users] Odd behavior, RT automatically reverts changes to Custom Fields

Matthew W. matt.k.wong at gmail.com
Thu Jun 14 09:48:24 EDT 2012


Hello,

I'm relatively new to RT and have been running into this problem for a
few days now.  I've looked everywhere and haven't found a clue.  The
closest thing I could find was documented in this post:

http://www.mail-archive.com/rt-users@lists.bestpractical.com/msg10037.html

But, I really don't want to to undo the changes that RT automatically
undoes....

Basically, whenever I make changes to a custom field from a scrip
whatever the value that I add automatically gets reverted back to the
old value.  I tried adding code to delete the old value first, but RT
just adds the old value back.


Here's some psuedocode (code not tested and may contain typos, but my
code works just fine as I can see the transactions in the ticket
history):

my $Value = 'some value';

my $CFName = 'customCF';
my $CF->LoadByName( Name => $CFName);

#Delete the old value:
$self->TicketObj>DeleteCustomFieldValue(
     Field => $CFName,
     Value => $self->TicketObj->FirstCustomFieldValue($CFName)
);

#Set the new value:
$self->TicketObj->AddCustomFieldValue( Field => $CF, Value => $Value);

Bottom line: does anyone know how to prevent RT from undoing the
additions to a custom field?  This is in RT 4.0.4.

--Matthew.



More information about the rt-users mailing list