Use the same Template when a ticket is created in a queue and when a ticket is moved to a new queue

Hello,

Currently, I have a Template called “Notify New Owners” run by a scrip
that is called every time a ticket is created in a Queue. It goes like
this:

  1. Stop unless Owner is Noboby
  2. Get the emails of all the people who work this Queue
  3. Send them a note saying a new ticket needs to be worked on.

When a tickets gets created by a new email, it works great. Thing is,
sometimes my internal users send their requests to the wrong address
or we realize the ticket needs to be moved to another Queue. In each
case, I want the same procedure to be followed meaning RT sending an
email to the folks working that new Queue telling them a new Ticket is
in.

Here is the problem with a simple table of Rights

User A can own a ticket in Queue 1
User B can own a ticket in Queue 1 AND Queue 2

A ticket gets created in Queue 1. User A and User B receive an email.
User A takes the ticket, finds out he can’t do much and moves it to
Queue 2.

Here is where it gets interesting:

  1. RT moves the ticket to the new Queue
  2. RT then runs the scrip with the “Notify New Owners” Template
  3. RT realizes that User A cannot work Queue 2
  4. RT disowns User A from the Ticket and attributes it the Nobody

The fact that action #4 happens after #2 makes it so that my logic in
"Notify New Owners" is not working.

I can’t simply remove the first check from my Template, here’s why: If
the ticket was owned by User B, since that user can work both Queues,
RT would not change ownership on queue change therefore no one needs
to be notified.

I hope I was clear enough. I’d love some advice on what to do here. Thanks guys.

Haïm.

  1. RT moves the ticket to the new Queue
  2. RT then runs the scrip with the “Notify New Owners” Template
  3. RT realizes that User A cannot work Queue 2
  4. RT disowns User A from the Ticket and attributes it the Nobody

The fact that action #4 happens after #2 makes it so that my logic in
"Notify New Owners" is not working.

I can’t simply remove the first check from my Template, here’s why: If
the ticket was owned by User B, since that user can work both Queues,
RT would not change ownership on queue change therefore no one needs
to be notified.

I hope I was clear enough. I’d love some advice on what to do here. Thanks guys.

What condition are you using, a custom one? You may need to tune it
to be On Create OR On Owner change to Nobody which will probably get
you what you want.

-kevin