Scrip to put a ticket in a queue in certain condition

Hi, I’m using RT 5.03,
I ask for help to create a script that, when creating a ticket, puts it in a specific queue if there are certain words in the subject or content. Has anyone done something similar before?

Thanks

PREPARATION:

my $t_subject = lc($self->TicketObj->Subject);
my $t_content = lc($self->TransactionObj->Attachments->First->Content);
my @findit = qw( sicra akro );

foreach (@findit) {
   if ( $t_subject =~ $_ ) {
     return 1; 
   }
}
foreach (@findit) {
   if ( $t_content =~ $_ ) {
     return 1; 
   }
}
return 0;

ACTION:

$self->TicketObj->SetQueue(9);

1 Like