Srikumar,
You could possibly use something like this:
# set basic values
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
#
# set new ticket Queue id value
#
# 1 - Queue 1
# 2- Queue 2
#
my %lvls = qw(
Support1 1
Support2 2
);
my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,Name => "Support Level");
# check for valid Support Level value first,
# then set new Ticket Queue ID
if ($cf->id)
{
my $cfvalue = $ticket->FirstCustomFieldValue('Support Level');
my $queueid = $lvls{$cfvalue};
$ticket->SetQueue($queueid);
}
return 1;
Obviously, you will have different values for your CF "Support Level", but I
think this will give yoiu an idea of how it works.
Hope it helps.
Kenn
LBNL
On Wed, Oct 19, 2011 at 1:40 PM, Srikumar Nair <[email protected]> wrote:
> I have a Custom Field on the Queue object called 'Support Level' with
> various support levels (Different Queue for different support levels)
> How can I choose the Queue (with Perl APIs) based on the Support Level I
> receive as input?
>
> I want to assign the Ticket to the correct queue during Ticket creation
> (BTW, I create Tickets with Perl APIs).
>
> Does any one has some Perl code snippets that uses the RT APIs?
>
> Thanks a bunch..
>
>
> --------
> RT Training Sessions (http://bestpractical.com/services/training.html)
> * Washington DC, USA — October 31 & November 1, 2011
> * Barcelona, Spain — November 28 & 29, 2011
>
--------
RT Training Sessions (http://bestpractical.com/services/training.html)
* Washington DC, USA October 31 & November 1, 2011
* Barcelona, Spain November 28 & 29, 2011