[Rt-devel] A couple of API questions

Kevin Falcone falcone at bestpractical.com
Wed Sep 23 12:59:04 EDT 2009


On Wed, Sep 23, 2009 at 11:20:16AM -0500, Fran Fabrizio 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

> 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.

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

-kevin


More information about the Rt-devel mailing list