[rt-users] Issue in round robin tickets
chandra prakash
chandra.mr.prakash at gmail.com
Tue May 10 00:56:23 EDT 2016
Dear All,
In my RT system we created a queue named "hostmaster" and assign one scrips
which is mentioned below but when we send mail then it's show in untaken
list.
Need your help.
my @owners = qw( 90 92 128); # need to grab id from Users table 128 @owners
push(@owners, @owners);
my $tickets = RT::Tickets->new($RT::SystemUser);
$tickets->LimitQueue(VALUE => 'hostmaster'); # my queue, yours may differ
$tickets->LimitId(VALUE => $self->TicketObj->Id, OPERATOR => '!=');
$tickets->OrderBy( FIELD => 'id', ORDER => 'DESC' );
my $last_ticket = $tickets->First;
my $last_owner = $last_ticket->Owner;
my $i = 0;
my $isSet = 0;
my $new_owner;
foreach $i (@owners) {
if ($owners[$i] == $last_owner) {
$new_owner = $owners[$i+1];
$self->TicketObj->SetOwner($new_owner);
$isSet = 1;
}
}
if (!($isSet)) {
my $randOwner = int(rand($#owners));
$randOwner = $owners[$randOwner];
$self->TicketObj->SetOwner($randOwner);
}
--------------------------------
Chandra Prakash
Sr Internet Resource Analyst
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20160510/85b55d3f/attachment.htm>
More information about the rt-users
mailing list