Strip the requestor - Assign to queue

Thanks everyone for yor help. The following will take a ticket based on
the conditions you specify in the prep code $match string and then
identify the ‘Requestors’, remove them, assign it to the queue you want
and change the owner to whomever you desire.

Hope it helps.

This is what I did:

Description = Whatever
Condition = On Create
Action = User Defined
Template = Black
Stage = TransactionCreate

Prep Code:
my $match = “^”;
my $t_subject = $self->TicketObj->Subject;
if ( $t_subject !~ /$match/ ) {
return 0;
}
else {
return 1;
}

Cleanup Code:
my $newqueue = “”;
my $newSystemUser = “”;
my $T_Obj = $self->TicketObj;
my $requestor = $self->TicketObj->RequestorAddresses;
my @watchers = split /,/,$requestor;

$RT::Logger->warning(“Scrip 145 found watchers:
$requestor”);

foreach my $watcher (@watchers) {
my ($status, $msg) =
$self->TicketObj->DeleteWatcher(Type=>‘Requestor’,Email=>$watcher);
}

$RT::Logger->info(“Auto assign ticket #”. $T_Obj->id ." to queue #".
$newqueue );
my ($status, $msg) = $T_Obj->SetQueue($newqueue);
unless ($status) {
$RT::Logger->warning(“unable to set new queue: $msg”);
return undef;
}

return 1;