[rt-users] Parse subject to extract keywords?

Peterson, Erik epeterson at edc.org
Thu Mar 20 15:48:33 EDT 2008


> Is there any way that I could parse the subject line to look for specific
> words, and based on those words, have a scrip change to a specific queue?

Hi Laura,

I have a scrip that does this. In the scrip, I have the following:

Condition: On Create
Action: User Defined
Template: Global Template: Blank


The "Custom action preparation code" is:

 return 0 unless ($self->TicketObj->Subject =~ /^new request/i);
 return 1;

And the "custom action clean up code" is:

 $self->TicketObj->SetQueue( 'service' );
 return 1;


You just need to change your regex and set the right queue names.  You can
do multiple patterns that each set to a different queue as well.

Hope that is helpful,
Erik




More information about the rt-users mailing list