Retrieve CF names by Queue

Could anyone give me a hint with some perl code with how to retrieve a list of all CFs for a particular queue?

Thanks.

Russ

Could anyone give me a hint with some perl code with how to retrieve a list of all CFs for a particular queue?

Thanks.

Russ

Here’s a little snippet of one of my scripts that is mostly Ruslan’s
doing.

% my $CFs = $QueueObj->CustomFields($ARGS{‘CustomField’});

% while (my $CF = $CFs->Next) {
% my $CFVs = $CF->Values();
% while ( my $CFV = $CFVs->Next ) {
% next unless $CFV->CustomField == $ARGS{‘CustomField’};

<% $CFV->Name %>
<% $CFV->Description %>

% }
% }

<%INIT>
use Data::Dumper;
$Data::Dumper::Indent=1;
use RT::Users;
use RT::Group;
use RT::Principal;
my $GroupObj = new RT::Group($session{‘CurrentUser’});
my $UserObj = new RT::Users($session{‘CurrentUser’});
my $QueueObj = new RT::Queue($session{‘CurrentUser’});
##my $PrincipalObj = $GroupObj->PrincipalId($QueueObj);
#my $PrincipalObj = $GroupObj->PrincipalObj($session{‘CurrentUser’});
$QueueObj->Load($Queue) || Abort (loc(“Queue could not be loaded.”));

</%INIT>

<%ARGS>
$Queue => 35
$CF => undef
$CFV => undef
</%ARGS>

In this case, I pass the custom field id to this script. Obviously
you wont need to include each and every line in the init block.

Andy Harrison
(full headers for details)