Change queue and owner based on requestor's email address

Hi all

I’m an absolute RT neophyte, so my apologies in advance. I’ve trawled
through previous listings for solutions to similar requirements, but because
I don’t speak its programming dialect, I’ve not been able to successfully
adapt things that I’ve found in the archives.

So here’s there the requirement:

We want to maintain just one customer service email address which goes
straight to RT, but would like each ticket to:

  1. be assigned to the relevant major customer queue, based on the domain of
    the requestor’s email address. For example, any email originating from
    "[anyone]@example.com" would go to the queue named “Example”.

There will also be situations in which we will need to match to an entire
email address rather than a domain, so an illustration of this variation
would also be helpful.

  1. be assigned to the customer’s account manager as owner.

But remembering my newbie status, I’d be grateful for any suggestions
regarding the most efficient way to implement this for maybe 25 cases.
Should I create a scrip for each different case, or build all of them into
one scrip?

I hope all this makes sense and will be very grateful for any assistance you
good folk can offer.

Thanks & regards

Neil (Perth, Western Australia)

Hi Neil

Hi all

I’m an absolute RT neophyte, so my apologies in advance. I’ve trawled
through previous listings for solutions to similar requirements, but because
I don’t speak its programming dialect, I’ve not been able to successfully
adapt things that I’ve found in the archives.

So here’s there the requirement:

We want to maintain just one customer service email address which goes
straight to RT, but would like each ticket to:

  1. be assigned to the relevant major customer queue, based on the domain of
    the requestor’s email address. For example, any email originating from
    “[anyone]@example.com” would go to the queue named “Example”.

There will also be situations in which we will need to match to an entire
email address rather than a domain, so an illustration of this variation
would also be helpful.

  1. be assigned to the customer’s account manager as owner.

But remembering my newbie status, I’d be grateful for any suggestions
regarding the most efficient way to implement this for maybe 25 cases.
Should I create a scrip for each different case, or build all of them into
one scrip?

I am guessing that it would be more efficient to have the check for
all the cases in the one scrip but I am a bit of a newbie myself so I
might be wrong. It looks like

http://wiki.bestpractical.com/index.cgi?SetOwnerAndQueueBySubject

matches pretty closely to want you want to do except that the match is
based on the subject rather than the requestor address. You would
match against the requestor address with something like this:

my $T_Obj = $self->TicketObj;
my $email = ($self->TicketObj->RequestorAddresses)[0];

if ($email =~ /[1]+@(\w+)[\w.]+/) {
my $newqueue = $1;
$RT::Logger->debug(“newqueue will be $newqueue”);
my ($status, $msg) = $T_Obj->SetQueue($newqueue1);
unless ($status) {
$RT::Logger->warning(“unable to set new queue: $msg”);
return undef;
}
}

I guess you might want to check in your custom condition code whether
the email address of the requestor actually matches a queue that you
have set up for a customer and if it hasn’t just let it pass through
to the main queue. Alternatively you could add a check in the code
above to see if the $newqueue already exists in RT and if it doesn’t
exit and let the request go through to the default queue.

By playing around with the regular expression match you would be able
to match to a specific email address so you might have to add some
additional elsif checks for those cases.

Hope this is useful.

cheers
John

I hope all this makes sense and will be very grateful for any assistance you
good folk can offer.

Thanks & regards

Neil (Perth, Western Australia)


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

John Habermann
Internet Programmer, System Administrator
The Wilderness Society Inc


  1. \w. ↩︎

Hi Neil;
for 2 create in each queue a custom scrip with condition on queue change and
action
$self->TicketObj->SetOwner(‘rt user account for account manager’)
For 1, I would go the mail alias route, I understand you want one customer
support email , however for your requirement you’ll be better of if each
customer have their support mail alias, such as your customer example should
email their support requests to example@YourSupportMail.comnetorg, customer
example2 will mail example2@YourSupportMail.comnetorg etc and each if these
email aliases will point to the customer queue ie
example@YourSupportMail.comnetorg will point to the Example queue, ie you’ll
have in your mail/alias something like:
example: rt-Example+Correspondnce
Regards;
RoyFrom: “Neil Hymans - Technically Speaking” info@techspeak.com.au
To: rt-users@lists.bestpractical.com
Sent: Friday, September 08, 2006 6:49 AM
Subject: [rt-users] Change queue and owner based on requestor’s email
address

Hi all

I’m an absolute RT neophyte, so my apologies in advance. I’ve trawled
through previous listings for solutions to similar requirements, but
because
I don’t speak its programming dialect, I’ve not been able to successfully
adapt things that I’ve found in the archives.

So here’s there the requirement:

We want to maintain just one customer service email address which goes
straight to RT, but would like each ticket to:

  1. be assigned to the relevant major customer queue, based on the domain
    of
    the requestor’s email address. For example, any email originating from
    “[anyone]@example.com” would go to the queue named “Example”.

There will also be situations in which we will need to match to an entire
email address rather than a domain, so an illustration of this variation
would also be helpful.

  1. be assigned to the customer’s account manager as owner.

But remembering my newbie status, I’d be grateful for any suggestions
regarding the most efficient way to implement this for maybe 25 cases.
Should I create a scrip for each different case, or build all of them into
one scrip?

I hope all this makes sense and will be very grateful for any assistance
you
good folk can offer.

Thanks & regards

Neil (Perth, Western Australia)


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


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 08/09/2006