Hi all,
I’m trying to write a scrip to run with every transaction on tickets,
but I only want it to really do what it’s supposed to do when one or two
custom fields change. My question is :
How can I see the old and new value of a ticket custom field on a
transaction object so that I can do it during the prepare stage?
Thanks in advance,
Carlos Silva
Carlos,
I use the following "User-Defined" condition to execute based on a
change to a CF:
condition execution on value of CF QA Approved and if the approver ID
is not the owner ID
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
if ($trans->Type eq ‘CustomField’)
{my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
Name => “QA Approved”);
return 0 unless $cf->id;
if ($trans->Field == $cf->id &&
$trans->NewValue eq “Yes”)
{
return 1;
}
}
return 0;
This basically checks the CF "QA Approved" to see if the value is what
I need before I execute. What I want it to do is in the cleanup area.
Hope this helps.
Kenn
LBNLOn 4/21/2008 12:19 PM, Carlos Silva wrote:
Hi all,
I’m trying to write a scrip to run with every transaction on tickets,
but I only want it to really do what it’s supposed to do when one or two
custom fields change. My question is :
How can I see the old and new value of a ticket custom field on a
transaction object so that I can do it during the prepare stage?
Thanks in advance,
Carlos Silva
The rt-users Archives
Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com
Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com