Category & description for custom field

Hi all,
How can I get category and description associated to a value of a custom field
we need that to use it in a scrip

Best regards

Marouane HIMDI
Ingénieur R&D
(Keys : monitoring, functionnal&load-Testing, request-tracketing, … )

Hi all,
How can I get category and description associated to a value of a custom
field
we need that to use it in a scrip

my $cf = $ticket->LoadCustomFieldByIdentifier( “CF name”);
my $value = $ticket->FirstCustomFieldValue( $cf->Name );

my $value_obj = RT::CustomFieldValue->new( $ticket->CurrentUser );
$value_obj->LoadByCols( CustomField => $cf->id, Name => $value );

my $cat = $value_obj->Category;
my $desc = $value_obj->Description;

Not tested but should be close.

Best regards

Marouane HIMDI
Ingénieur R&D
(Keys : monitoring, functionnal&load-Testing, request-tracketing, … )


RT Training Sessions (http://bestpractical.com/services/training.html)

  • Boston — March 5 & 6, 2012

Best regards, Ruslan.

Thanks Ruslan for your reactivity
I’ll test that

----- Mail original -----De: “Ruslan Zakirov” ruz@bestpractical.com
À: “Marouane HIMDI” marouane.himdi@kereval.com
Cc: “rt-users” rt-users@lists.bestpractical.com
Envoyé: Jeudi 8 Décembre 2011 11:01:58
Objet: Re: [rt-users] category & description for custom field

Hi all,
How can I get category and description associated to a value of a custom
field
we need that to use it in a scrip

my $cf = $ticket->LoadCustomFieldByIdentifier( “CF name”);
my $value = $ticket->FirstCustomFieldValue( $cf->Name );

my $value_obj = RT::CustomFieldValue->new( $ticket->CurrentUser );
$value_obj->LoadByCols( CustomField => $cf->id, Name => $value );

my $cat = $value_obj->Category;
my $desc = $value_obj->Description;

Not tested but should be close.

Best regards

Marouane HIMDI
Ingénieur R&D
(Keys : monitoring, functionnal&load-Testing, request-tracketing, … )


RT Training Sessions (http://bestpractical.com/services/training.html)

  • Boston — March 5 & 6, 2012

Best regards, Ruslan.