Hi guys! Since a couple of days, I have the problem, that my priority escalation script doesn't work anymore. Script is attached...
The error message is: Name "RT::SystemUser" used only once: possible typo at ./rt-escalatePriority line 36. Can't locate object method "Deprecated" via package "RT" at /opt/rt4/lib/RT/Interface/CLI.pm line 93. I currently cannot figure out, what's the problem with the mentioned line 36: my $queues = new RT::Queues($RT::SystemUser); Does anybody know this problem? Greetings, Markus
#!/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 # <URL:http://wiki.bestpractical.com/index.cgi?ConfigureEscalationExample> # and # <URL:http://wiki.bestpractical.com/index.cgi?ConfigureEscalation> # # 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"); }