[rt-users] change queue not triggering Scrip
a.smith at ldex.co.uk
a.smith at ldex.co.uk
Fri Mar 27 13:54:33 EDT 2015
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;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20150327/4f6b4c31/attachment.htm>
More information about the rt-users
mailing list