<div dir="ltr">Dear All,<div><br></div><div>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.</div><div><br></div><div>Need your help.</div><div><br></div><div><div><br></div><div>my @owners = qw( 90 92 128); # need to grab id from Users table 128 @owners</div><div>push(@owners, @owners);</div><div><br></div><div>my $tickets = RT::Tickets->new($RT::SystemUser);</div><div>$tickets->LimitQueue(VALUE => 'hostmaster'); # my queue, yours may differ</div><div>$tickets->LimitId(VALUE => $self->TicketObj->Id, OPERATOR => '!=');</div><div>$tickets->OrderBy( FIELD => 'id', ORDER => 'DESC' );</div><div>my $last_ticket = $tickets->First;</div><div>my $last_owner = $last_ticket->Owner;</div><div><br></div><div>my $i = 0;</div><div>my $isSet = 0;</div><div>my $new_owner;</div><div><br></div><div><br></div><div>foreach $i (@owners) {<br></div><div>if ($owners[$i] == $last_owner) {</div><div>$new_owner = $owners[$i+1];</div><div>$self->TicketObj->SetOwner($new_owner);</div><div>$isSet = 1;</div><div>}</div><div>}</div><div><br></div><div>if (!($isSet)) {</div><div>my $randOwner = int(rand($#owners));</div><div>$randOwner = $owners[$randOwner];</div><div>$self->TicketObj->SetOwner($randOwner);</div><div>} </div><div><br></div><br><div class="gmail_signature"><div dir="ltr">--------------------------------<br>Chandra Prakash<br>Sr Internet Resource Analyst<br><br><br></div></div>
</div></div>