Move tickets to Queue

Dear,

As I’m new to RT I’m trying to setup a system for our needs.
We want a queue for each customer. Tickets are created by email.
So I want to test this with my own gmail address:

I’ve created a queue called ‘Gmail’.

In the General queue I’ve created a Scrip:

Condition: On Create
Action: User defined
Template: Global template: Blank
Stage: TransactionCreate

Custom action cleanup code:

if ($self->TicketObj->RequestorAddresses =~ /polloxx@gmail.com/){
$self->TicketObj->SetQueue(“Gmail”);
return(1);
}

return(undef);

So a new created ticket should move from the ‘General’ to the 'Gmail’
queue but it doesn’t. What am I doing wrong?

Thx,
P.

Hi!
Why you don’t create “gmail” -queue email alias?
/etc/aliases
gmail: |/opt/rt3/bin/rt-mailgate --queue ‘gmail’ --action correspond --url
http://support.company.com/"

so when customer sends email to address gmail@company.com, it goes automaticly
to gmail -queue!On Monday, 22. Februaryta 2010 16:25:33 polloxx wrote:

Dear,

As I’m new to RT I’m trying to setup a system for our needs.
We want a queue for each customer. Tickets are created by email.
So I want to test this with my own gmail address:

I’ve created a queue called ‘Gmail’.

In the General queue I’ve created a Scrip:

Condition: On Create
Action: User defined
Template: Global template: Blank
Stage: TransactionCreate

Custom action cleanup code:

if ($self->TicketObj->RequestorAddresses =~ /polloxx@gmail.com/){
$self->TicketObj->SetQueue(“Gmail”);
return(1);
}

return(undef);

So a new created ticket should move from the ‘General’ to the 'Gmail’
queue but it doesn’t. What am I doing wrong?

Thx,
P.


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

JJussi

We only want one helpdesk address to send to. Depending on the from
address tickets should go to the appropriate queue.On Mon, Feb 22, 2010 at 3:40 PM, JJussi rt-users@jjussi.com wrote:

Hi!
Why you don’t create “gmail” -queue email alias?
/etc/aliases

gmail: |/opt/rt3/bin/rt-mailgate --queue ‘gmail’ --action correspond --url
http://support.company.com/"

so when customer sends email to address gmail@company.com, it goes automaticly
to gmail -queue!

On Monday, 22. Februaryta 2010 16:25:33 polloxx wrote:

Dear,

As I’m new to RT I’m trying to setup a system for our needs.
We want a queue for each customer. Tickets are created by email.
So I want to test this with my own gmail address:

I’ve created a queue called ‘Gmail’.

In the General queue I’ve created a Scrip:

Condition: On Create
Action: User defined
Template: Global template: Blank
Stage: TransactionCreate

Custom action cleanup code:

if ($self->TicketObj->RequestorAddresses =~ /polloxx@gmail.com/){
$self->TicketObj->SetQueue(“Gmail”);
return(1);
}

return(undef);

So a new created ticket should move from the ‘General’ to the 'Gmail’
queue but it doesn’t. What am I doing wrong?

Thx,
P.


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


JJussi


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

if ($self->TicketObj->RequestorAddresses =~ /polloxx@gmail.com/){
$self->TicketObj->SetQueue(“Gmail”);
return(1);
}

What happens when you check the return values of SetQueue?
You’ll get two values, a $value and a $msg if $value is 0, the $msg
will contain the error.

You may also need to make your scrip TransactionBatch, but you should
always check return values.

-kevin

As I’m new to RT I’m trying to setup a system for our needs.
We want a queue for each customer. Tickets are created by email.
You may want to rethink this, as it seems like a really bad idea.
It could potentially make the system extremely unwieldy due to the
number of queues, and potential difficulty managing ACLs
or templates?

You do know that messages automatically get threaded right?
And that the system is searchable? (with RTx::From you need
only type from:polloxx to get to a list of all of your tickets) Also,
RT automagically links to several other tickets from a requestor
in the ticket display?

As I’m new to RT I’m trying to setup a system for our needs.
We want a queue for each customer. Tickets are created by email.

However, if you really want to do this, and assuming you
have a relatively fixed set of requestors/queues, the easiest way to
handle this would be running rt-mailgate
with --extension=queue; of course, your current method of scrips
permits you to programatically create a
morasse of queues.

Cambridge Energy Alliance: Save money. Save the planet.

Thanks for all your suggestions.
How can I do this using Scrips, so without the need to go to /etc/aliases?

@Kevin: How do I check the return value of Setqueue?
@Jerrad: We only have a limited number of customers and needed queues.On Tue, Feb 23, 2010 at 3:31 AM, Jerrad Pierce jpierce@cambridgeenergyalliance.org wrote:

On Mon, Feb 22, 2010 at 16:30, Jerrad Pierce jpierce@cambridgeenergyalliance.org wrote:

As I’m new to RT I’m trying to setup a system for our needs.
We want a queue for each customer. Tickets are created by email.

However, if you really want to do this, and assuming you
have a relatively fixed set of requestors/queues, the easiest way to
handle this would be running rt-mailgate
with --extension=queue; of course, your current method of scrips
permits you to programatically create a
morasse of queues.


Cambridge Energy Alliance: Save money. Save the planet.

How about your own version of ‘rt-mailgate’.
Take existing rt-mailgate and add little bit code in it what selects right
queue base on sender address.

Then you just need that one /etc/aliases line:

support:"|my-rt-mailgate --action comment --url http://domain.com/"

This is not what you have asked, but better choose right queue outside RT than
inside.On Tuesday, 23. Februaryta 2010 15:16:42 polloxx wrote:

Thanks for all your suggestions.
How can I do this using Scrips, so without the need to go to /etc/aliases?

@Kevin: How do I check the return value of Setqueue?
@Jerrad: We only have a limited number of customers and needed queues.

On Tue, Feb 23, 2010 at 3:31 AM, Jerrad Pierce jpierce@cambridgeenergyalliance.org wrote:

On Mon, Feb 22, 2010 at 16:30, Jerrad Pierce jpierce@cambridgeenergyalliance.org wrote:

As I’m new to RT I’m trying to setup a system for our needs.
We want a queue for each customer. Tickets are created by email.

However, if you really want to do this, and assuming you
have a relatively fixed set of requestors/queues, the easiest way to
handle this would be running rt-mailgate
with --extension=queue; of course, your current method of scrips
permits you to programatically create a
morasse of queues.


Cambridge Energy Alliance: Save money. Save the planet.


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

JJussi

I’ve solved this by using procmail instead of /etc/aliases. It might
not be the most elegant solution but it works for me:

:0

:0
| /opt/rt3/bin/rt-mailgate --queue ‘General’ --action correspond --url
http://domain.tldOn Tue, Feb 23, 2010 at 3:38 PM, JJussi rt-users@jjussi.com wrote:

How about your own version of ‘rt-mailgate’.
Take existing rt-mailgate and add little bit code in it what selects right
queue base on sender address.

Then you just need that one /etc/aliases line:

support:"|my-rt-mailgate --action comment --url http://domain.com/"

This is not what you have asked, but better choose right queue outside RT than
inside.

On Tuesday, 23. Februaryta 2010 15:16:42 polloxx wrote:

Thanks for all your suggestions.
How can I do this using Scrips, so without the need to go to /etc/aliases?

@Kevin: How do I check the return value of Setqueue?
@Jerrad: We only have a limited number of customers and needed queues.

On Tue, Feb 23, 2010 at 3:31 AM, Jerrad Pierce jpierce@cambridgeenergyalliance.org wrote:

On Mon, Feb 22, 2010 at 16:30, Jerrad Pierce jpierce@cambridgeenergyalliance.org wrote:

As I’m new to RT I’m trying to setup a system for our needs.
We want a queue for each customer. Tickets are created by email.

However, if you really want to do this, and assuming you
have a relatively fixed set of requestors/queues, the easiest way to
handle this would be running rt-mailgate
with --extension=queue; of course, your current method of scrips
permits you to programatically create a
morasse of queues.


Cambridge Energy Alliance: Save money. Save the planet.


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


JJussi


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Thanks for all your suggestions.
How can I do this using Scrips, so without the need to go to /etc/aliases?

I am also interested in trying to setup the same thing with a Scrip in
RT. We currently have a script that runs via procmail, which looks for
certain keywords and automatically re-route tickets to the appropriate
queue before ticket creation. We use this for automatic ticket
exchanges with a sister support center that is using FootPrints, but we
are in the process of testing an improved system that won’t use email
exchanges.

Instead it uses a SOAP interface on the FP side and REST on RT. Because
there will be no more email to intercept before RT and I would like to
do the queue routing on the receiving side (RT), I would like to have a
Scrip in RT that can change the Queue for a ticket before it is created.
Is this even possible in RT with an “On Create” condition and custom
action preparation or cleanup code? I am not sure how, or if it is even
possible to intercept and change the parameters of a ticket creation
transaction before it is created.

I tried a Scrip similar to the one that started this thread, which did
work for me, but it effectively created the ticket in the original
queue, then moved it to the new queue, with only the queue change email
going to the watchers of the new queue and the original ticket request
going to the watchers of the original queue.

Is what I am trying to do even possible with a Scrip in RT?

~Jason

/------------------------------------------------------------------
| Jason A. Smith Email: smithj4@bnl.gov |
| Atlas Computing Facility, Bldg. 510M Phone: +1-631-344-4226 |
| Brookhaven National Lab, P.O. Box 5000 Fax: +1-631-344-7616 |
| Upton, NY 11973-5000, U.S.A. |
------------------------------------------------------------------/

smime.p7s (3.88 KB)