Problem with RT::SystemUser in escalatePriority

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

rt-escalatePriority.txt (1.2 KB)

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

Hi Markus,

remove the following lines

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);

with

use RT::Interface::CLI qw(Init);
Init();
my $queues = RT::Queues->new(RT->SystemUser);

Also, do you have different Lifecycles defined?
If not, then you can use the rt-crontool with

–search RT::Search::FromSQL

and a search like

-search-arg “Status != ‘resolved’ AND Status != ‘rejected’”

instead if use a Perl script to loop over the queues and then call
rt-crontool from within the Perl script.

See also the second example in
https://www.bestpractical.com/docs/rt/4.2/automating_rt.html#Escalating-Priority

Chris

Hi Christian!

Thanks a lot for your response! This solved my problem!

As we have different lifecycles in place, I stay with looping through all
queues…

Greetings,
Markus

Von:
Christian Loos cloos@netcologne.de
An:
markus.wildbolz@magna.com, rt-users@lists.bestpractical.com,
Datum:
29.10.2015 15:33
Betreff:
Re: Problem with RT::SystemUser in escalatePriorityAm 29.10.2015 um 13:58 schrieb markus.wildbolz@magna.com:

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

Hi Markus,

remove the following lines

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);

with

use RT::Interface::CLI qw(Init);
Init();
my $queues = RT::Queues->new(RT->SystemUser);

Also, do you have different Lifecycles defined?
If not, then you can use the rt-crontool with

–search RT::Search::FromSQL

and a search like

-search-arg “Status != ‘resolved’ AND Status != ‘rejected’”

instead if use a Perl script to loop over the queues and then call
rt-crontool from within the Perl script.

See also the second example in
https://www.bestpractical.com/docs/rt/4.2/automating_rt.html#Escalating-Priority

Chris

OK, then remember this, once you will upgrade to RT 4.4, because this
version will support [1] searches like

Status = ‘active

Chris

[1] https://github.com/bestpractical/rt/commit/20f3268Am 29.10.2015 um 15:39 schrieb markus.wildbolz@magna.com:

Hi Christian!

Thanks a lot for your response! This solved my problem!

As we have different lifecycles in place, I stay with looping through
all queues…

Greetings,
Markus