Multiple faces for single queue?

Hi list,

Is there an existing solution to have a single queue (used for product
support) to be used for multiple clients? In our case, different
clients require different support email addresses and ticket auto-
response messages, but all other queue behavior, watchers, scrips etc
is the same.

I’m sure it would not be difficult to, on ticket creation, parse the
incoming messages for a “To:” header and set a “Client” custom field
based on this. Then for all other actions (auto response, etc), we
could use this custom field to look up the appropriate templates.
However, I was wondering if this had already been done, as it seems
like it would be a common RT usage scenario.

Regards,
Tom

Tom,

You pretty much stated your own answer. Yes, by using a CF you can set 

up several scrips to execute when the value of the CF is “whatever” or
“whatever2”, etc. Each scrip would specify a different template to be
used for the customers with the correct value. Example below:

Condition: User Defined

Action: Notify Customer type X

Template: Global template: Ticket Created for X Customer

condition execution on CF QA Approved

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

if ($trans->Type eq ‘CustomField’)
{my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
Name => “Customer Type”);
return 0 unless $cf->id;
if ($trans->Field == $cf->id &&
$trans->NewValue eq “X”)
{
return 1;
}
}

return 0;

And the same for a different customer type:

Condition: User Defined

Action: Notify Customer type Z

Template: Global template: Ticket Created for Z Customer

condition execution on CF QA Approved

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

if ($trans->Type eq ‘CustomField’)
{my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
Name => “Customer Type”);
return 0 unless $cf->id;
if ($trans->Field == $cf->id &&
$trans->NewValue eq “Z”)
{
return 1;
}
}

return 0;

These two notification scrips will use a different template for the 

customer based on the value of the CF. Hope this helps.

Kenn
LBNLOn 4/21/2008 8:08 PM, Tom Lanyon wrote:

Hi list,

Is there an existing solution to have a single queue (used for product
support) to be used for multiple clients? In our case, different
clients require different support email addresses and ticket auto-
response messages, but all other queue behavior, watchers, scrips etc
is the same.

I’m sure it would not be difficult to, on ticket creation, parse the
incoming messages for a “To:” header and set a “Client” custom field
based on this. Then for all other actions (auto response, etc), we
could use this custom field to look up the appropriate templates.
However, I was wondering if this had already been done, as it seems
like it would be a common RT usage scenario.

Regards,
Tom


The rt-users Archives

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

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

Thanks for the response, Kenneth.

Sure, I know it is possible; I was more curious whether anyone was
already doing it and whether there was code already publicly available
to make my life easier. :slight_smile:

The only issue I’m not certain of, is whether there would be a way to
modify the “From” address of mail sent by RT depending on a “Client”
CustomField. Has anyone done this?

Cheers,
TomOn 23/04/2008, at 2:24 AM, Kenneth Crocker wrote:

Tom,

You pretty much stated your own answer. Yes, by using a CF you can
set up several scrips to execute when the value of the CF is
“whatever” or “whatever2”, etc. Each scrip would specify a different
template to be used for the customers with the correct value.
Example below:

Condition: User Defined

Action: Notify Customer type X

Template: Global template: Ticket Created for X Customer

condition execution on CF QA Approved

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

if ($trans->Type eq ‘CustomField’)
{my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
Name => “Customer Type”);
return 0 unless $cf->id;
if ($trans->Field == $cf->id &&
$trans->NewValue eq “X”)
{
return 1;
}
}

return 0;

And the same for a different customer type:

Condition: User Defined

Action: Notify Customer type Z

Template: Global template: Ticket Created for Z Customer

condition execution on CF QA Approved

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

if ($trans->Type eq ‘CustomField’)
{my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
Name => “Customer Type”);
return 0 unless $cf->id;
if ($trans->Field == $cf->id &&
$trans->NewValue eq “Z”)
{
return 1;
}
}

return 0;

These two notification scrips will use a different template for the
customer based on the value of the CF. Hope this helps.

Kenn
LBNL

On 4/21/2008 8:08 PM, Tom Lanyon wrote:

Hi list,
Is there an existing solution to have a single queue (used for
product support) to be used for multiple clients? In our case,
different clients require different support email addresses and
ticket auto- response messages, but all other queue behavior,
watchers, scrips etc is the same.
I’m sure it would not be difficult to, on ticket creation, parse
the incoming messages for a “To:” header and set a “Client” custom
field based on this. Then for all other actions (auto response,
etc), we could use this custom field to look up the appropriate
templates. However, I was wondering if this had already been done,
as it seems like it would be a common RT usage scenario.
Regards,
Tom

Hi Tom,

You can put any valid-loooking address you want in the From: line as long
as your MTA doesn’t care. You can’t change the sender info in the e-mail
envelope, though, but most recipients will never see that.

Regards,
Gene

At 07:41 PM 4/22/2008, Tom Lanyon wrote:

The only issue I’m not certain of, is whether there would be a way to
modify the “From” address of mail sent by RT depending on a “Client”
CustomField. Has anyone done this?

Cheers,
Tom

Tom,

  You pretty much stated your own answer. Yes, by using a CF you can

set up several scrips to execute when the value of the CF is
“whatever” or “whatever2”, etc. Each scrip would specify a different
template to be used for the customers with the correct value.
Example below:

Condition: User Defined

Action: Notify Customer type X

Template: Global template: Ticket Created for X Customer

condition execution on CF QA Approved

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

if ($trans->Type eq ‘CustomField’)
{my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
Name => “Customer Type”);
return 0 unless $cf->id;
if ($trans->Field == $cf->id &&
$trans->NewValue eq “X”)
{
return 1;
}
}

return 0;

  And the same for a different customer type:

Condition: User Defined

Action: Notify Customer type Z

Template: Global template: Ticket Created for Z Customer

condition execution on CF QA Approved

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

if ($trans->Type eq ‘CustomField’)
{my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
Name => “Customer Type”);
return 0 unless $cf->id;
if ($trans->Field == $cf->id &&
$trans->NewValue eq “Z”)
{
return 1;
}
}

return 0;

  These two notification scrips will use a different template for the

customer based on the value of the CF. Hope this helps.

Kenn
LBNL

Hi list,
Is there an existing solution to have a single queue (used for
product support) to be used for multiple clients? In our case,
different clients require different support email addresses and
ticket auto- response messages, but all other queue behavior,
watchers, scrips etc is the same.
I’m sure it would not be difficult to, on ticket creation, parse
the incoming messages for a “To:” header and set a “Client” custom
field based on this. Then for all other actions (auto response,
etc), we could use this custom field to look up the appropriate
templates. However, I was wondering if this had already been done,
as it seems like it would be a common RT usage scenario.
Regards,
Tom

Gene LeDuc, GSEC
Security Analyst
San Diego State University

Tom,

I haven't altered the "From", only the "To". However, I'm sure the 

principal is the same. Check out “Headers” at the best practical wiki
list. I’m there is something there.

Kenn
LBNLOn 4/22/2008 7:41 PM, Tom Lanyon wrote:

Thanks for the response, Kenneth.

Sure, I know it is possible; I was more curious whether anyone was
already doing it and whether there was code already publicly available
to make my life easier. :slight_smile:

The only issue I’m not certain of, is whether there would be a way to
modify the “From” address of mail sent by RT depending on a “Client”
CustomField. Has anyone done this?

Cheers,
Tom

On 23/04/2008, at 2:24 AM, Kenneth Crocker wrote:

Tom,

You pretty much stated your own answer. Yes, by using a CF you can 

set up several scrips to execute when the value of the CF is
“whatever” or “whatever2”, etc. Each scrip would specify a different
template to be used for the customers with the correct value. Example
below:

Condition: User Defined

Action: Notify Customer type X

Template: Global template: Ticket Created for X Customer

condition execution on CF QA Approved

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

if ($trans->Type eq ‘CustomField’)
{my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
Name => “Customer Type”);
return 0 unless $cf->id;
if ($trans->Field == $cf->id &&
$trans->NewValue eq “X”)
{
return 1;
}
}

return 0;

And the same for a different customer type:

Condition: User Defined

Action: Notify Customer type Z

Template: Global template: Ticket Created for Z Customer

condition execution on CF QA Approved

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

if ($trans->Type eq ‘CustomField’)
{my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
Name => “Customer Type”);
return 0 unless $cf->id;
if ($trans->Field == $cf->id &&
$trans->NewValue eq “Z”)
{
return 1;
}
}

return 0;

These two notification scrips will use a different template for 

the customer based on the value of the CF. Hope this helps.

Kenn
LBNL

On 4/21/2008 8:08 PM, Tom Lanyon wrote:

Hi list,
Is there an existing solution to have a single queue (used for
product support) to be used for multiple clients? In our case,
different clients require different support email addresses and
ticket auto- response messages, but all other queue behavior,
watchers, scrips etc is the same.
I’m sure it would not be difficult to, on ticket creation, parse the
incoming messages for a “To:” header and set a “Client” custom field
based on this. Then for all other actions (auto response, etc), we
could use this custom field to look up the appropriate templates.
However, I was wondering if this had already been done, as it seems
like it would be a common RT usage scenario.
Regards,
Tom