Rt-crontool configure to set/move queue of ticket

Hi list,

I’m interested in using rt-crontool to manage tickets, specifically
I’d like to have unowned tickets automatically moved to another queue
after X minutes. The issue I have is that there isn’t a default perl
module for this in “Actions”, can anyone suggest how I can achieve this?
If there’s some other way I can achieve my goal not using rt-crontool
then I’d obviously be very happy for any other suggestions,

thanks in advance, Andy.

Ok, so I’ve cobbled together a custom actions module like this:

use strict;
use warnings;
use RT::Queue;
use base qw(RT::Action);

package RT::Action::Test;

my $self;

sub Prepare {
my $self = shift;

return 1;
}

sub Commit {
my $self = shift;

my ($status, $msg) = $self->TicketObj->SetQueue(“Support2nd”);
if ( not $status ) {
RT::Logger->error(“Could not reassign queue: $msg”);
}

return 1;
}

1;

To get to where I want it to be I now need to work out where the
"–action-arg" is being passed or how to read that from within the
module, is it the second arguement of $self?
Also what is the easiest way to notify all AdminCCs from within the
module?

thanks! Andy.

Ok, I’ve robbed the code:

my $argument = $self->Argument;
unless ( $argument ) {
$RT::Logger->error(“Argument is mandatory for Test action”);
return 0;
}

So now I can read in --action-arg.

For the email on queue change I tried creating a Scrip to do this via
the GUI, this works fine if I change the queue via the GUI but when
rt-crontool does it I don’t get the notification :(. TBH I’d rather do
this directly in my custom perl module so any help would be gratefully
recieved on an easy way to achieve this, I want to notify AdminCCs,

thanks, Andy.