[rt-users] changing Priority from script
matthew zeier
mrz at intelenet.net
Thu Apr 21 16:51:11 EDT 2005
I have the following code snippet from an exteral program. It queries all
tickets in a particular queue and changes priority and owner if it hasn't
been touched in an hour.
Do I have the syntax for setting a new owner correct? What's the way to
change priority?
# Get hold of new and open tickets only
my $tickets = new RT::Tickets($RT::SystemUser);
$tickets->LimitStatus(VALUE => 'new');
$tickets->LimitQueue(VALUE => $queue->Id);
$tickets->LimitPriority(OPERATOR => '<', VALUE => "10");
# Process each ticket
while (my $ticket = $tickets->Next) {
if ((time()-$ticket->LastUpdatedObj->Unix)/3600 >= $idleTime) {
$ticket->SetOwner($ownerNames[$newOwner]);
# change priority?
# $ticket->SetPriority($newPri);
}
}
More information about the rt-users
mailing list