Hi,
I need help with one scrip i am working on. It seems like it is not activating.
General Info :
RT version : 4.4.1 on Ubuntu Server 16.04 LTS
Goal : On create check for specific words on the subject and change queue accordingly.
I have tried the following variations :
- on normal and on batch stage.
- applied on one queue and globally
- with On Create condition and with user defined
- tried with/without the custom preparation code
- on the system log with debug on i am not getting anything related to this scrip
- the scrip is first on the scrip list (Named “1OnCreateMoveToQueueBySubject”)
- custom action without any conditioning works
On Create condition scrip setup :
Custom Condition : Null
Custom action preparation code :
$RT::Logger->debug("!!!WORKS!!!\n"); (For testing purposes, got no results)
Custom action commit code :
my @SubjectFilter = ('Test','Test2','AddYourNewWordHere');
my $t_subject = $self->TicketObj->Subject;
my $msg = $t_subject;
if ( grep { $t_subject =~ /(^|\s+)$_(\s+|$)/i } @SubjectFilter ) {
my $newqueue = "5";
my $T_Obj = $self->TicketObj;
$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;
}
}
else {
return 0;
}
User Defined scrip setup :
Custom Condition :
my @SubjectFilter = ('Test','Test2','AddYourNewWordHere');
my $t_subject = $self->TicketObj->Subject;
my $msg = $t_subject;
if ( grep { $t_subject =~ /(^|\s+)$_(\s+|$)/i } @SubjectFilter ) {
return 1;
}
else {
return 0;
}
Custom action preparation code :
$RT::Logger->debug("!!!WORKS!!!\n"); (For testing purposes, got no results)
Custom action commit code :
my $newqueue = "5";
my $T_Obj = $self->TicketObj;
$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;