Add watcher based on email address or domain

Hi all

I have a requirement to add specific watchers to a ticket based on who sent

My first attempt involved creating a queue for each customer, with each
queue having the appropriate watchers set up. A scrip changes the queue of
an incoming ticket based on the email address or domain. This works fine,
but it has resulted in about 25 queues so far and this number will grow as
sales increase.

Instead, I was thinking that I could skip the whole queue changing thing - I
think it would be fine if a scrip looked at the email address / domain and
added a username as a watcher.

Unfortunately, I speak very little Perl and am pretty new to all of this. If
anyone cares to help, I’d be very grateful if you could illustrate your
response with about 3 cases so it’s obvious to me how to modify it so suit
our requirements - and perhaps also show how to check both a complete email
address and a domain.

Thanks in advance for any help you can offer.

Best regards



Why do you need separate "watchers" for each ticket? Each Requestor of 

a ticket will have their own E_mail address anyway and whatever
privileges you want this “watcher” to have you can grant via the
"Requestor" role either globally or per queue. If the privileges are to
be the same, regardless of who sent a ticket, then grant the privileges
to the “Requestor” role globally. What is the real purpose behind the
separate watcher concept?


Neil Hymans - Technically Speaking wrote:

I guess Neil was referring to client managers/sales managers /customer
relations agents etc …
I don’t think its a simple task particularly you said you speak very
little Perl …
If you can; what I would do is: option 1 (the clean way)

  • Create a table that map your customer mail address to an agent (the
    watcher you need to add --this can be user name or mailaddress)
  • Create the appropriate classes for this table (I often use
    sbin/factory from the rt source code)
  • Create a function in the above classes to pull the agent for a given
    customer email
  • Create a scrip with Condition On Create and action to query the
    function you created above and add the value as a watcher
    Option 2 (not so clean):
  • Assuming your customer email is already an RT user, use one of the
    fields that are n’t used in the Users table to populate the email
    address/name of teh watcher
  • Create a scrip with Condition On Create and action to identify the
    requester, pull the value of the field mentioned above and add it as a
    Best of luck;

Kenneth Crocker wrote: