#!/usr/bin/perl # # This script is one way to escalate ticket priorities for all queues. # # Author: Petter Reinholdtsen # Date: 2004-08-31 # # Based on shell version previously on # # and # # # Run from cron as user rt-user, making sure rt-user is also a privileged # RT user with 'Unix name' set to rt-user and having global permissions # ShowTicket and ModifyTicket. use strict; use warnings; # Location of RT's libs and scripts use lib ("/opt/rt4/lib", "/opt/rt4/local/lib"); my $crontool = "/opt/rt4/bin/rt-crontool"; package RT; use RT::Interface::CLI qw(CleanEnv); # Clean our the environment CleanEnv(); # Load the RT configuration RT::LoadConfig(); # Initialise RT RT::Init(); my $queues = new RT::Queues($RT::SystemUser); $queues->LimitToEnabled(); # escalate tickets for all queues while (my $queue = $queues->Next) { my $queuename = $queue->Name; system("$crontool --search RT::Search::ActiveTicketsInQueue " . "--search-arg \"$queuename\" ". "--action RT::Action::MyEscalatePriority"); }