[rt-users] round-robin auto assignment?
matthew zeier
mrz at intelenet.net
Wed Dec 15 18:44:50 EST 2004
Condition: On Create
Action: User Defined
Template: blank
Stage: TransactionCreate
I pasted what you had into "Custom action prep code" . Its a scrip just
for a particular queue. I'm seeing the following error:
[Wed Dec 15 23:35:51 2004] [error]: Scrip 57 Prepare failed: Global symbol
"$Ticket" requires explicit package name at (eval 2222) line 6.
Global symbol "$Ticket" requires explicit package name at (eval 2222) line
17.
(/opt/rt3/lib/RT/Action/UserDefined.pm:65)
What's the right way to reference $Ticket?
my @owners = qw( mrz jstein vzwick ); #could create a group for this
push(@owners, @owners);
my $tickets = RT::Tickets->new($RT::System);
$tickets->LimitQueue(VALUE => 'my queue');
$tickets->LimitId(VALUE => $Ticket->Id, OPERATOR => '!=');
$tickets->OrderBy( FIELD => 'id', ORDER => 'DESC' );
my $last_ticket = $tickets->First;
my $last_owner = $last_ticket->Owner->Name;
my $i = 0;
my $new_owner;
while (1) {
if ($owners[$i] eq $last_owner) {
$new_owner = $owners[$i+1];
$Ticket->SetOwner($new_owner);
last;
}
}
More information about the rt-users
mailing list