A couple of API questions

I am in the process of creating an extension and have a couple of
questions.

  1. I would like the users to be able to select one or more queues as
    input for the report. Right now I am doing a SelectQueue Element, which
    only allows the choice of one queue. What would be the best way to
    achieve “select one or more queues” functionality? I browsed the
    available Elements and nothing jumped out on first pass.

  2. If I already have a queue’s ID, is there an easier way to retrieve
    the object for that queue than what I am doing now:

my $queues = new RT::Queues($session{CurrentUser});
$queues->Limit(FIELD => “Id”, OPERATOR => “=”, VALUE => $queueId);
my $queueobj = $queues->Next;

I have the same question for users, given the user’s Name value. I was
wondering if there was something like my $queueobj = new RT::Queue(Id =>
$queueId) or similar, but wasn’t able to find anything similar in the
perldoc.

Thanks,
Fran

Fran Fabrizio
Senior Systems Analyst
Department of Computer and Information Sciences
University of Alabama at Birmingham

205.934.0653

  1. I would like the users to be able to select one or more queues as
    input for the report. Right now I am doing a SelectQueue Element, which
    only allows the choice of one queue. What would be the best way to
    achieve “select one or more queues” functionality? I browsed the
    available Elements and nothing jumped out on first pass.

You’ll probably need to make a custom selectqueue for that

  1. If I already have a queue’s ID, is there an easier way to retrieve
    the object for that queue than what I am doing now:

my $queues = new RT::Queues($session{CurrentUser});
$queues->Limit(FIELD => “Id”, OPERATOR => “=”, VALUE => $queueId);
my $queueobj = $queues->Next;

I have the same question for users, given the user’s Name value. I was
wondering if there was something like my $queueobj = new RT::Queue(Id =>
$queueId) or similar, but wasn’t able to find anything similar in the
perldoc.

You want the Load function, which you can find implemented on a number
of objects and also in DBIx::SearchBuilder.

-kevin

Kevin Falcone wrote:

  1. I would like the users to be able to select one or more queues as
    input for the report. Right now I am doing a SelectQueue Element, which
    only allows the choice of one queue. What would be the best way to
    achieve “select one or more queues” functionality? I browsed the
    available Elements and nothing jumped out on first pass.

You’ll probably need to make a custom selectqueue for that

Ok, I’ll try to start from SelectQueue and see if I can make sense of
how to create custom Elements.

[SNIP]

You want the Load function, which you can find implemented on a number
of objects and also in DBIx::SearchBuilder.

Thanks!!

Fran Fabrizio
Senior Systems Analyst
Department of Computer and Information Sciences
University of Alabama at Birmingham

205.934.0653

Kevin Falcone wrote:

  1. I would like the users to be able to select one or more queues as
    input for the report. Right now I am doing a SelectQueue Element, which
    only allows the choice of one queue. What would be the best way to
    achieve “select one or more queues” functionality? I browsed the
    available Elements and nothing jumped out on first pass.

You’ll probably need to make a custom selectqueue for that

Ok, I’ll try to start from SelectQueue and see if I can make sense of
how to create custom Elements.

It is very easy, just set multiple on select box that is rendered by
SelectQueue and then you can get them as list in mason component.
Probably additional argument in SelectQueue to allow people to select
multiple queues can be even comitted into the core.

Best regards, Ruslan.