Hi Landon et al,
for any interested I did finally get this
working, the trick was adding "RT::Base->_ImportOverlays();" before the
final "return 1" in the commit subroutine. Once I added this the Scrip
with condition on queue change started working as per when changing
queues via the GUI.
So in case anyone else wants a custom action they
can use from rt-crontool for changing queues here is my final
code:
package RT::Action::QChange;
use strict;
use warnings;
use
base qw(RT::Action::Notify);
use Email::Address;
sub Prepare {
my
$self = shift;
return 1;
}
my $self;
sub Commit {
my $self =
shift;
my $argument = $self->Argument;
unless ( $argument ) {
$RT::Logger->error("Argument is mandatory for Test action");
return 0;
}
my ($status, $msg) = $self->TicketObj->SetQueue("$argument");
if (
not $status ) {
RT::Logger->error("Could not reassign queue: $msg");
return 0;
}
RT::Base->_ImportOverlays();
return 1;
}
1;