[rt-users] newbie script / Action question

Alex Peters alex at peters.net
Fri Dec 12 06:55:20 EST 2014


If you want RT to manage this, then I would agree that using a scrip is the
correct way to move tickets into different queues based on the appearance
of certain keywords in the subject.

Another option would be to handle it at the MTA (e.g. procmail) level, and
change the rt-mailgate command line accordingly per queue.  Being an RT
concern though, perhaps it's better to keep those rules within RT.

If the scrips stop working again and are actually failing, they will
definitely emit errors into the RT log (as long as the log is writeable, of
course!).

I wouldn't be too concerned about not seeing the "ChangeQueue" action in
the drop-down list, because there's no way to pass parameters to such
actions and in your case, because the destination queue varies based on
subject, you'd need to pass a different queue as a parameter.

Instead, perhaps just write a custom action that does the comparing and
moving all in one go.  Something like:

my $subject = $self->TicketObj->Subject;
my $queue;
if ($subject =~ /regex1/) {
  $queue = 'queue-for-regex-1';
}
elsif ($subject =~ /regex2/) {
  $queue = 'queue-for-regex-2';
}
elsif ($subject =~ /regex3/) {
  $queue = 'queue-for-regex-3';
}

$self->TicketObj->SetQueue($queue) if defined $queue;

On 6 December 2014 at 05:06, Karres, Dean <karres at illinois.edu> wrote:
>
>  Hi,
>
>
>
> Please feel free to point me at the correct docs here.  I think I am about
> to get a handle on some RT related thing and then it turns to smoke in my
> fingers :)
>
>
>
> Part of this is a “Best Practices” question.  We are testing RT at the
> moment so playing around is fine with the goal of a solid system at the far
> end.
>
>
>
> In our case I envision the following: a “tree” of Queues “rooted” at the
> primary “Helpdesk” queue.  All initial Customer interactions should come
> into the primary Helpdesk Queue.  Then a combination of human interaction
> and auto-filters should sort the inbound queue items into other “Word
> Queues”.
>
>
>
> The “auto-filter” bit is where I am having some issues.  I have seen the
> doc at: http://requesttracker.wikia.com/wiki/WriteCustomAction on Custom
> Actions.  I have used the GUI interface to create two Scripts that look at
> the main Queue and change the Queue for inbound tickets that have keywords
> in the Subject.  For example our Helpdesk sends special printing requests
> to a printing department and a sub-set of the Helpdesk staff can handle a
> limited number of trivial Personnel “status” issues.
>
>
>
> The Best-Practice question is: is this the best way to deal with these
> sorts of tickets and Queues?  I just want to move tickets that
> pattern-match X into special-queue-X.  There will be several other queues
> and the Helpdesk staff will sort inbound tickets into them as necessary.
>
>
>
> The tech question part has two parts:
>
> 1)      I used the GUI to create the filters as I mentioned above.  I saw
> no errors in the creation and they worked for a couple of hours then
> started failing for no obvious reason.  During this same time I was
> changing some MySQL innodb config options.  But then this morning the
> filter scripts magically started working again.  I don’t understand why
> they stopped or restarted.  I am not seeing (or am not looking in the right
> place) other debug info that might clue me in.
>
> 2)      In the link above it talks about writing a module to perform the
> action of the script(s).  It talks about registering the modules.  The
> question here is really, while looking through /opt/rt4/lib/…/Actions I see
> a ChangeQueue module/action.  While creating the scripts through the GUI
> the list of drop-down Actions did not include “Change Queue”.  That’s
> really what I want to do here.  Should that exist in the Action list?  How
> do I enable it if it should?
>
>
>
>
>
> Dean…K…
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20141212/4093a96c/attachment.html>


More information about the rt-users mailing list