Create a scrip in RT 4

I am very new to RT, We are running on RT 4.0.5
I have OpenNMS setup to notify RT using the RT notification module in OpenNMS. It is working great.
All of my OpenNMS notifications are created in a single queue called NMS.
I want to be able to redirect those tickets to different queues based on the subject line.

I have no Idea what I am doing.
Could someone help me with some sample code and how to implement it in RT4?

Say for instance I receive a ticket from OpenNMS with the subject line that contains the words "Paper Jam"
I want this to go to my queue called “Printer/Copier/Scannner”

How would I set this up in RT 4

Here is an example of a ticket that came from OpenNMS.

Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.502 (Entity 5.502)
Content-Length: 56

There is Paper jamed in the copier/printer: Copy Rm 6030

Van Howell
System Administrator
Lubbock Christian University

I am very new to RT, We are running on RT 4.0.5
I have OpenNMS setup to notify RT using the RT notification module in OpenNMS. It is working
great.
All of my OpenNMS notifications are created in a single queue called NMS.
I want to be able to redirect those tickets to different queues based on the subject line.

I have no Idea what I am doing.

Could someone help me with some sample code and how to implement it in RT4?

Say for instance I receive a ticket from OpenNMS with the subject line that contains the words
“Paper Jam”

I want this to go to my queue called “Printer/Copier/Scannner”

I’d probably use

-kevin

I installed the module you listed below according to the instructions on the cpan page.

I’m getting this error on my browser now…

mkdir /opt/rt4/var/mason_data/obj/3540243414: Permission denied at /usr/local/share/perl5/HTML/Mason/Compiler/ToObject.pm line 107

Van Howell
System Administrator
Lubbock Christian University-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kevin Falcone
Sent: Thursday, March 22, 2012 4:43 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Create a scrip in RT 4

On Thu, Mar 22, 2012 at 08:58:57PM +0000, Howell, Van wrote:

I am very new to RT, We are running on RT 4.0.5
I have OpenNMS setup to notify RT using the RT notification module in OpenNMS. It is working
great.
All of my OpenNMS notifications are created in a single queue called NMS.
I want to be able to redirect those tickets to different queues based on the subject line.

I have no Idea what I am doing.

Could someone help me with some sample code and how to implement it in RT4?

Say for instance I receive a ticket from OpenNMS with the subject line that contains the words
“Paper Jam”

I want this to go to my queue called “Printer/Copier/Scannner”

I’d probably use

-kevin

Never mind,
I checked the owner, obj was set to root. I changed it to apache and it works.

Van Howell
System Administrator
Lubbock Christian UniversityFrom: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Howell, Van
Sent: Friday, March 23, 2012 9:03 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Create a scrip in RT 4

I installed the module you listed below according to the instructions on the cpan page.

I’m getting this error on my browser now…

mkdir /opt/rt4/var/mason_data/obj/3540243414: Permission denied at /usr/local/share/perl5/HTML/Mason/Compiler/ToObject.pm line 107

Van Howell
System Administrator
Lubbock Christian University

Let me see if I understand how this custom action works.

Do I edit the file /opt/rt4/local/plugins/RT-Action-MoveQueue By Subjec/Lib/RT/Action/MoveQueueBySubject.pm

Changing …
Set(@MoveQueueBySubjectConditions,
‘^begin’, ‘Start’,
‘end$’, ‘Finale’,
);

To look for the string I want, like…

Set(@MoveQueueBySubjectConditions, gr /Paper Jam/i );

I set the variable $queue to the queue I want it to go to?

My $queue = ‘Printer/Copier/Scanner’

Or the queue number…

My $queue = 6

Van Howell
System Administrator
Lubbock Christian University-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kevin Falcone
Sent: Thursday, March 22, 2012 4:43 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Create a scrip in RT 4

On Thu, Mar 22, 2012 at 08:58:57PM +0000, Howell, Van wrote:

I am very new to RT, We are running on RT 4.0.5
I have OpenNMS setup to notify RT using the RT notification module in OpenNMS. It is working
great.
All of my OpenNMS notifications are created in a single queue called NMS.
I want to be able to redirect those tickets to different queues based on the subject line.

I have no Idea what I am doing.

Could someone help me with some sample code and how to implement it in RT4?

Say for instance I receive a ticket from OpenNMS with the subject line that contains the words
“Paper Jam”

I want this to go to my queue called “Printer/Copier/Scannner”

I’d probably use

-kevin

Let me see if I understand how this custom action works.

Do I edit the file /opt/rt4/local/plugins/RT-Action-MoveQueue By Subjec/Lib/RT/Action/MoveQueueBySubject.pm

No, do not edit that file.

Changing …
Set(@MoveQueueBySubjectConditions,
‘^begin’, ‘Start’,
‘end$’, ‘Finale’,
);

This is from the documentation, so changing it would never affect
anything anyway.

Also from the documentation:

It is a list of regular expressions and queues.

So looking back up at the example you quote, if the subject starts
with begin, put this in the Start queue, if the subject ends with end,
put it in the Finale queue.

To look for the string I want, like…

Set(@MoveQueueBySubjectConditions, gr /Paper Jam/i );

I set the variable $queue to the queue I want it to go to?

My $queue = ‘Printer/Copier/Scanner’

Or the queue number…

My $queue = 6

A few things. The operator is qr// not gr//, but you don’t use qr
here, you just use a string, like the docs show. You put a simple
regular expression in there and then put the queue name next. If it
makes it easier for you to read, you can even write:

Set( @MoveQueueBySubjectConditions, ‘Paper Jam’ => ‘Printer/Copier/Scanner’ );

If you need to be case insensitive, see the note in the docs about how
to do that.

-kevin

Where do I put this statement…
Set( @MoveQueueBySubjectConditions, ‘Paper Jam’ => ‘Printer/Copier/Scanner’ );

Van Howell
System Administrator
Lubbock Christian UniversityFrom: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kevin Falcone
Sent: Friday, March 23, 2012 10:33 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Create a scrip in RT 4

Let me see if I understand how this custom action works.

Do I edit the file /opt/rt4/local/plugins/RT-Action-MoveQueue By
Subjec/Lib/RT/Action/MoveQueueBySubject.pm

No, do not edit that file.

Changing …
Set(@MoveQueueBySubjectConditions,
‘^begin’, ‘Start’,
‘end$’, ‘Finale’,
);

This is from the documentation, so changing it would never affect anything anyway.

Also from the documentation:

It is a list of regular expressions and queues.

So looking back up at the example you quote, if the subject starts with begin, put this in the Start queue, if the subject ends with end, put it in the Finale queue.

To look for the string I want, like…

Set(@MoveQueueBySubjectConditions, gr /Paper Jam/i );

I set the variable $queue to the queue I want it to go to?

My $queue = ‘Printer/Copier/Scanner’

Or the queue number…

My $queue = 6

A few things. The operator is qr// not gr//, but you don’t use qr here, you just use a string, like the docs show. You put a simple regular expression in there and then put the queue name next. If it makes it easier for you to read, you can even write:

Set( @MoveQueueBySubjectConditions, ‘Paper Jam’ => ‘Printer/Copier/Scanner’ );

If you need to be case insensitive, see the note in the docs about how to do that.

-kevin

I think I figured it out.

The statement goes in the RT_SiteConfig file.

I’m a bit brain-dead today.

Van Howell
System Administrator
Lubbock Christian UniversityFrom: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Howell, Van
Sent: Friday, March 23, 2012 11:00 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Create a scrip in RT 4

Where do I put this statement…
Set( @MoveQueueBySubjectConditions, ‘Paper Jam’ => ‘Printer/Copier/Scanner’ );

Van Howell
System Administrator
Lubbock Christian University

From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kevin Falcone
Sent: Friday, March 23, 2012 10:33 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Create a scrip in RT 4

Let me see if I understand how this custom action works.

Do I edit the file /opt/rt4/local/plugins/RT-Action-MoveQueue By
Subjec/Lib/RT/Action/MoveQueueBySubject.pm

No, do not edit that file.

Changing …
Set(@MoveQueueBySubjectConditions,
‘^begin’, ‘Start’,
‘end$’, ‘Finale’,
);

This is from the documentation, so changing it would never affect anything anyway.

Also from the documentation:

It is a list of regular expressions and queues.

So looking back up at the example you quote, if the subject starts with begin, put this in the Start queue, if the subject ends with end, put it in the Finale queue.

To look for the string I want, like…

Set(@MoveQueueBySubjectConditions, gr /Paper Jam/i );

I set the variable $queue to the queue I want it to go to?

My $queue = ‘Printer/Copier/Scanner’

Or the queue number…

My $queue = 6

A few things. The operator is qr// not gr//, but you don’t use qr here, you just use a string, like the docs show. You put a simple regular expression in there and then put the queue name next. If it makes it easier for you to read, you can even write:

Set( @MoveQueueBySubjectConditions, ‘Paper Jam’ => ‘Printer/Copier/Scanner’ );

If you need to be case insensitive, see the note in the docs about how to do that.

-kevin