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

Paul Tomblin ptomblin at xcski.com
Thu Jun 14 12:02:39 EDT 2012


On Thu, Jun 14, 2012 at 9:48 AM, Matthew W. <matt.k.wong at gmail.com> wrote:
> 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);

When I call AddCustomFieldValue, I use the field *name* in Field,
rather than an actual CustomField class.  So I do things like
   $parent->AddCustomFieldValue("Field" => "custom_status", "Value" =>
$newStatus);
and that seems to work fine.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin



More information about the rt-users mailing list