Custom field change is two transactions

Hello,

I want to subtact $txn->NewValue from $txn->OldValue but they are not
both set in the same transaction

When i change a custom field value, it seems to be two transactions, one
removing the old value and another adding the new value, but it seems
the new value is added before the new value is removed

here i change a value from 8 to 5

[19537] [Sat Sep 10 15:49:11 2016] [debug]: Committing scrip #21 on txn
#756 of ticket #24 (/var/www/sm-rt/sbin/…/lib/RT/Scrips.pm:293)
[19537] [Sat Sep 10 15:49:11 2016] [error]: Newvalue=5 Oldvalue= ((eval
546):2)

[19537] [Sat Sep 10 15:49:11 2016] [debug]: Committing scrip #21 on txn
#757 of ticket #24 (/var/www/sm-rt/sbin/…/lib/RT/Scrips.pm:293)
[19537] [Sat Sep 10 15:49:11 2016] [error]: Newvalue= Oldvalue=8 ((eval
549):2)

condition is on custom field change

custom action code

my $txn = $self->TransactionObj;
$RT::Logger->error(“Newvalue=”.$txn->NewValue." Oldvalue=".$txn->OldValue);

I see other custom field changes that are from Yes to No showing both
new and old values in the same transaction.

eg

[19537] [Sat Sep 10 15:49:11 2016] [debug]: Committing scrip #21 on txn
#754 of ticket #24 (/var/www/sm-rt/sbin/…/lib/RT/Scrips.pm:293)
[19537] [Sat Sep 10 15:49:11 2016] [error]: Newvalue=Yes Oldvalue=No
((eval 539):2)

what’s going on? I’m confused!

w.

Richard Wood (Woody)
Managing Director
Wild Thing Safaris Ltd.

UK: 2B Habbo St, Greenwich, London
Dar es Salaam: 5 Ethan St, Mbezi beach
Arusha: 3 Ebeneezer Rd, Njiro
PO BOX 34514 DSM
Office: +255 (0) 222 617 166
Office Mobile: +255 (0) 773 503 502
Direct: +255 742 373 327
Skype: woody1tz
http://wildthingsafaris.com