Scrip change customfieldvalue on certain value

Hi,

has anyone a scrip or an idea how my condition for the following
situation has to be written?

My customfield called “CFA” has for example the value “value1” and
“value2”. The value is currently set to “value1”. I now want my scrip to
check wheather the value has changed and to which value it has changed.
And that is exactly my problem. How do I check what the new value is?

The first part would be:

if ($self->TransactionObj->Type eq “CustomField” &&

and what comes after && ??

Thanks a lot for your help!

Violetta

________________________________ creating IT solutions
Violetta J. Wawryk science + computing ag
IT-Service Hagellocher Weg 73
phone +49 7071 9457 282 72070 Tuebingen, Germany
fax +49 7071 9457 211 www.science-computing.de
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196

Violetta,

Try something like this:

condition execution on value of CF “CFA”

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 => “CFA”);
return 0 unless $cf->id;
if ($trans->Field == $cf->id &&
$trans->NewValue eq “Value1”)
{
my $current_Value = “Value1”;
return 1;
}
else
{
my $current_Value = $trans->NewValue;
}
}

return 0;

Something along those lines should work. I didn't know if you wanted to 

save the new value or do something, etc. Hope this helps.

Kenn
LBNLOn 10/17/2008 7:16 AM, Violetta Wawryk wrote:

Hi,

has anyone a scrip or an idea how my condition for the following
situation has to be written?

My customfield called “CFA” has for example the value “value1” and
“value2”. The value is currently set to “value1”. I now want my scrip to
check wheather the value has changed and to which value it has changed.
And that is exactly my problem. How do I check what the new value is?

The first part would be:

if ($self->TransactionObj->Type eq “CustomField” &&

and what comes after && ??

Thanks a lot for your help!

Violetta