Need to trigger scrip on ticket moved *out* of queue

Good morning!

We are trying to set up a scrip that will notify a pager email address when
a ticket is moved out of one particular queue, regardless of the destination
queue.

Ordinarily, we could put this on the global scrips, but we only want it to
affect one queue. Since the messages will go to a pager, we don’t want a page
every time anyone moves any ticket anywhere. :slight_smile:

The initial thought was to use the “On Queue Change” condition, but it appears
that fires at the destination queue rather than at the source queue. I was
able to get our scrip to work when we move a ticket into the queue, but not
when something moves out. As with global, we can’t just put this scrip on all
the other queues, because then we’ll be bombarded with unwanted notifications.

Here’s what I have now, for testing:

Description: Notify pager when ticket moved out
Condition: On Queue Change
Action: Notify AdminCCs
Template: Global template: Transaction
Stage: Transaction Create

Custom conditions/actions: none

We’ll probably change the action to a custom action once we get the triggering
right. For now, I just want to validate that a known-working action is fired
when the event of interest occurs.

Do I need to go to a custom condition for this? If so, what determines when
my conditional expression is evaluated?

Thanks for any advice.

Scott

Scott Courtney | “I don’t mind Microsoft making money. I mind them
scott@4th.com | having a bad operating system.” – Linus Torvalds
http://4th.com/ | (“The Rebel Code,” NY Times, 21 February 1999)
| PGP Public Key at http://4th.com/keys/scott.pubkey

We use this non-global scrip:

Description: QueueTransfer
Condition: On Queue Change
Action: Notify Other Recipients
Template: New Ticket in Queue
Stage: Transaction Create

The template is a simple message we created letting the helpdesk staff a
new ticket is sitting out there. So when a user’s queue changes into
ours, the distribution list gets notified. Here is what it looks like:

CC: dl-helpdesk@compupay.com

A new ticket has been created.

Ticket #{$Ticket->id()}
Requestor: {$Ticket->Requestors->MemberEmailAddressesAsString()}

Description:
{ $Ticket->Transactions->First->Content; }

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Scott
Courtney
Sent: Tuesday, May 22, 2007 9:38 AM
To: RT-Users@lists.bestpractical.com
Subject: [rt-users] Need to trigger scrip on ticket moved out of queue

Good morning!

We are trying to set up a scrip that will notify a pager email address
when
a ticket is moved out of one particular queue, regardless of the
destination
queue.

Ordinarily, we could put this on the global scrips, but we only want it
to
affect one queue. Since the messages will go to a pager, we don’t want a
page
every time anyone moves any ticket anywhere. :slight_smile:

The initial thought was to use the “On Queue Change” condition, but it
appears
that fires at the destination queue rather than at the source queue. I
was
able to get our scrip to work when we move a ticket into the queue,
but not
when something moves out. As with global, we can’t just put this scrip
on all
the other queues, because then we’ll be bombarded with unwanted
notifications.

Here’s what I have now, for testing:

Description: Notify pager when ticket moved out
Condition: On Queue Change
Action: Notify AdminCCs
Template: Global template: Transaction
Stage: Transaction Create

Custom conditions/actions: none

We’ll probably change the action to a custom action once we get the
triggering
right. For now, I just want to validate that a known-working action is
fired
when the event of interest occurs.

Do I need to go to a custom condition for this? If so, what determines
when
my conditional expression is evaluated?

Thanks for any advice.

Scott

Scott Courtney | “I don’t mind Microsoft making money. I mind
them
scott@4th.com | having a bad operating system.” – Linus
Torvalds
http://4th.com/ | (“The Rebel Code,” NY Times, 21 February 1999)
| PGP Public Key at
http://4th.com/keys/scott.pubkey
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

This Electronic message contains information from CompuPay which may
be privileged. The information is intended to be for the use of the
addressee only. If you are not the addressee, or the employee or agent
responsible to deliver it to the intended recipient, note that any
disclosure, copy distribution or use of the contents of this message
is prohibited. If you have received this Electronic Message in error,
please promptly notify the sender by return e-mail. For more
information regarding our company please visit www.compupay.com
http://www.compupay.com/

Description: QueueTransfer
Condition: On Queue Change
Action: Notify Other Recipients
Template: New Ticket in Queue
Stage: Transaction Create

The template is a simple message we created letting the helpdesk staff a
new ticket is sitting out there. So when a user’s queue changes into
ours, the distribution list gets notified. Here is what it looks like:

Thanks for the template example. This will be helpful, because I can use
it to make a really terse message for our pager.

Unfortunately, your condition is the same as what I have now, which is that
it triggers when the ticket moves into the queue. I need to trigger when
the ticket moves out of the queue.

Scott

Scott Courtney | “I don’t mind Microsoft making money. I mind them
scott@4th.com | having a bad operating system.” – Linus Torvalds
http://4th.com/ | (“The Rebel Code,” NY Times, 21 February 1999)
| PGP Public Key at http://4th.com/keys/scott.pubkey

At Tuesday 5/22/2007 09:37 AM, Scott Courtney wrote:

Good morning!

We are trying to set up a scrip that will notify a pager email address when
a ticket is moved out of one particular queue, regardless of the destination
queue.

Do I need to go to a custom condition for this? If so, what determines when
my conditional expression is evaluated?

Thanks for any advice.

Scott

Scott,

I think you need a global scrip with a custom condition something like this:

if ($self->TransactionObj->Type eq “Set”
&& $self->TransactionObj->Field eq “Queue”
&& $self->TransactionObj->OldValue eq “nnnnn”
) {
return 1;
} else {
return 0;
}

where nnnnn is the id of the queue you are interested in

Steve