[rt-users] changing Priority from script

Ruslan Zakirov Ruslan.Zakirov at miet.ru
Fri Apr 22 10:41:29 EDT 2005


See "Simple example" and last snippet from "code snippets" in
http://wiki.bestpractical.com/index.cgi?WriteCustomAction

matthew zeier wrote:

>
> 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);
>
>
>  }
>
> }
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com
>




More information about the rt-users mailing list