[rt-users] checking/changing default queue for a user

Boris Epstein borepstein at gmail.com
Tue Jul 21 11:59:28 EDT 2015

Roman, Aaron, thanks!

The code looks pretty good and I am sure this is one way to get the job

But what I am wondering is this. Even without any scrips - effectively,
triggers performing custom functions for a particular user of set of users
- the queue gets set up somehow. Then the questions becomes, how? And why
can this not be just a default setting? For instance, if I have two
companies that I provide IT services to, say, "Alpha Motors" and "Bravo
Tires" with a queue dedicated to each one why can't I just assign every
Alpha user  to the Alpha queue and every Bravo user to the Bravo queue just
through the configuration menu? Not saying a feature like this has to exist
already - I personally failed to find it - but it seems like it would make
sense for it to exist.



On Thu, Jul 16, 2015 at 4:40 PM, Roman Massey <romanmassey at gmail.com> wrote:

> Here’s a scrip I use for assigning queue depending on requestor email
> address.
> I stripped it down for you so this code is not tested. It runs through a
> hash so you can put multiple addresses corresponding to multiple queues. If
> you only need to do it for one address then you can eliminate the hash and
> while loop. The regex checks if the requestor email address contains the
> hash key. So you can put a full email address instead of just the domain.
> Create a new scrip (condition: On Create, Action: User defined, Template:
> blank) and I applied it to our “INCOMING” queue which all tickets created
> by email go into.
> Custom action preparation code:
> # initialize vars
> my $DestinationQueue;
> my $RequestorEmail = $self->TicketObj->RequestorAddresses;
> # map domains to queue name
> my %DomainToQueueName = (
> 'example.com' => 'Example Queue',
> 'example2.com' => 'Example Queue #2',
> );
> # iterate through dealership list and set the value to put in the CF
> while ( my $Key = each %DomainToQueueName )
> {
> if( $RequestorEmail=~ /\Q$Key/ ) {
> $DestinationQueue = $DomainToQueueName{$Key};
> }
> }
> #set the queue
> if($DestinationQueue) {
> my( $st, $msg ) = $self->TicketObj->SetQueue($DestinationQueue);
> }
> return 1;
> --
> Roman Massey
> On July 15, 2015 at 5:50:27 PM, Aaron McCormack (aaron at backblaze.com)
> wrote:
> Hi Boris,
> Mixing bits of these two might get you on the right track with a scrip
> processing the ticket upon creation, I use something similar for regex
> matching patterns in subject lines and assigning to a specific queue.
> http://requesttracker.wikia.com/wiki/SetOwnerAndQueueBySubject
> http://requesttracker.wikia.com/wiki/AutomaticCustomFieldValue
> Aaron
>  On Jul 14, 2015, at 2:18 PM, Boris Epstein <borepstein at gmail.com> wrote:
>  Hello listmates,
> If I as an admin need to set a certain queue for requests originating from
> a user - how do I do that? Let us say I have a user John Smith, with an
> email of jsmith at abc.com. How do I make it so that every ticket by email
> coming from jsmith at abc.com goes into a certain queue.
> Thanks.
> Boris.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20150721/40426552/attachment.htm>

More information about the rt-users mailing list