Hi there,
I can’t figure how to know in a scrip if some CF changes its value. Well, the code is at the first glance quite clear:
return 0 unless ($self->TransactionObj->Type eq "CustomField");
my $old = $self->TransactionObj->OldValue;
my $new = $self->TransactionObj->NewValue;
But I am confused how to select the custom field which this should apply on. When changing only one custom field at a time, it’s OK. When changing more custom fields at once, it’s giving various results because this scrip triggers on various transactions. Maybe the condition is wrong because there should be something like
return 0 unless (($self->TransactionObj->Type eq "CustomField") && ($self->TransactionObj->Name eq "CFname"));
But there is not such a thing.
The RT::CustomField class doesn’t have any OldValue so I can not use something like
my $cf = $self->TransactionObj->LoadCustomFieldByIdentifier('CFname');
my $old = $cf->OldValue; #error RT::CustomField::OldValue Unimplemented
And I can not also use
$self->TicketObj->FirstCustomFieldValue('CFname')
because this gives me only the actual value but not the old one as “OldValue” is also not defined for class RT::Ticket.
Does anybody have a hint for this?