[rt-users] Get value of a transaction custom field

Ruslan Zakirov ruz at bestpractical.com
Fri Dec 9 11:23:36 EST 2011


Hi,

If you do it in a scrip then sadly custom fields on transactions are
set too later for TransactionCreate scrips. Try batch scrips.

On Fri, Dec 9, 2011 at 17:56, Constant DAIX <cdx at kereval.com> wrote:
> Hi everybody,
>
> Could someone tell me how to get the value of a transaction custom field ?
>
> I tried a lot of functions but I can't get this value. I just can have the name and the description of this custom field, the content, subject, headers of the reply associated to the custom field.
>
> Code used :
>
> my $Value = 1;
> my $Transactions = $self->TicketObj->Transactions;
> my $TCustomFields = $Transactions->First->CustomFields;
> while (my $TCustomField = $TCustomFields->Next())
> {
>     my $nam = $TCustomField->Name;
>     if ($nam eq 'CFName') {
>
>         $Value = $Transactions->First->FirstCustomFieldValue($nam);
>
>     }
>     else {
>         $Value = 55;
>     }
> }
>
> $RT::Logger->info( "Value is :" . $Value);
>
> --> This always returns ' '.
>
>
> Thanks for your help.
>
> Regards,
>
> Constant
> --------
> RT Training Sessions (http://bestpractical.com/services/training.html)
> * Boston  March 5 & 6, 2012



-- 
Best regards, Ruslan.



More information about the rt-users mailing list