Question about "On Queue Change" Scrip Condition

Hi,

We’re running RT 3.8.8 and we need to fire a scrip when a ticket is
transferred away from a queue (to any possible destination).

The condition built into RT “On queue change” only seems to fire when a
ticket is transferred in but not when a ticket is transferred out.

I’ve tried various possible workarounds in custom conditions and even
changing the stage of the transaction but to no avail.

Does anyone have a clue as to what kind of condition I could use to
trigger my scrip when a ticket is transferred out ?
These possible conditions do not work:

my $transaction = $self->TransactionObj;
return($transaction->Type = “Set” && $transaction->Field = “Queue” &&
$transaction->OldValue eq “queuename”);
return($transaction->Type = “Set” && $transaction->Field = “Queue” &&
$transaction->NewValue ne “queuename”);

Thanks,

  • David

You need to have a global scrip that check for a queue change
and if the previous queue was the queue that you want to track
or react to exits.

Cheers,
KenOn Mon, Sep 20, 2010 at 01:19:32PM -0400, David Moreau Simard wrote:

Hi,

We’re running RT 3.8.8 and we need to fire a scrip when a ticket is
transferred away from a queue (to any possible destination).

The condition built into RT “On queue change” only seems to fire when a
ticket is transferred in but not when a ticket is transferred out.

I’ve tried various possible workarounds in custom conditions and even
changing the stage of the transaction but to no avail.

Does anyone have a clue as to what kind of condition I could use to trigger
my scrip when a ticket is transferred out ?
These possible conditions do not work:

my $transaction = $self->TransactionObj;
return($transaction->Type = “Set” && $transaction->Field = “Queue” &&
$transaction->OldValue eq “queuename”);
return($transaction->Type = “Set” && $transaction->Field = “Queue” &&
$transaction->NewValue ne “queuename”);

Thanks,

  • David

RT Training in Washington DC, USA on Oct 25 & 26 2010
Last one this year – Learn how to get the most out of RT!

This is so weird… would it be a bug ? Because the code certainly
doesn’t behave the way I would expect.

I’ve tried several things as a global scrip as Kenneth recommended:
Condition: User Defined
Action: User Defined
Template: Blank

Custom Condition:
my $Transaction = $self->TransactionObj;

Attempt #1

return($transaction->Type = “Set” && $transaction->Field = “Queue” &&
$transaction->OldValue eq “queuename”);

This will return true only if the ticket is transferred TO
queuename, it will not trigger if it is transferred away from queuename

Attempt #2

return($transaction->Type = “Set” && $transaction->Field = “Queue” &&
$transaction->NewValue eq “queuename”);

Same result as attempt #1 (How can this be?)

I’ve done other attempts but still in vain.

This should really be trivial as I’m used to toying with RT conditions
and actions but I somehow can’t figure this one out.On 10-09-20 1:27 PM, Kenneth Marshall wrote:

Hi David,

If there is not an alternative in the wiki, it probably does not
exist. (yet) At a first glance, I do not know how you would do
it without triggering on every queue change, whether the functionality
were built-in or not. In any case, the queue change action should be
much less frequent than many other actions so the impact should not
be too bad. YMMV

Regards,
Ken

On 10-09-20 1:21 PM, Kenneth Marshall wrote:

You need to have a global scrip that check for a queue change
and if the previous queue was the queue that you want to track
or react to exits.

Cheers,
Ken

On Mon, Sep 20, 2010 at 01:19:32PM -0400, David Moreau Simard wrote:

Hi,

We’re running RT 3.8.8 and we need to fire a scrip when a ticket is
transferred away from a queue (to any possible destination).

The condition built into RT “On queue change” only seems to fire when a
ticket is transferred in but not when a ticket is transferred out.

I’ve tried various possible workarounds in custom conditions and even
changing the stage of the transaction but to no avail.

Does anyone have a clue as to what kind of condition I could use to trigger
my scrip when a ticket is transferred out ?
These possible conditions do not work:

my $transaction = $self->TransactionObj;
return($transaction->Type = “Set”&& $transaction->Field = “Queue”&&
$transaction->OldValue eq “queuename”);
return($transaction->Type = “Set”&& $transaction->Field = “Queue”&&
$transaction->NewValue ne “queuename”);

Thanks,

  • David

RT Training in Washington DC, USA on Oct 25& 26 2010
Last one this year – Learn how to get the most out of RT!

David,

Maybe it’s just the way the typing looks, but it looks like you defined my
$Transaction with a capitol “T”, but when you specify it in the code, it has
a lowercase “t”. This might cause a problem. What did you see in your log
file?

Kenn
LBNLOn Mon, Sep 20, 2010 at 12:53 PM, David Moreau Simard fooraide@gmail.comwrote:

This is so weird… would it be a bug ? Because the code certainly doesn’t
behave the way I would expect.

I’ve tried several things as a global scrip as Kenneth recommended:
Condition: User Defined
Action: User Defined
Template: Blank

Custom Condition:
my $Transaction = $self->TransactionObj;

Attempt #1

return($transaction->Type = “Set” && $transaction->Field = “Queue” &&
$transaction->OldValue eq “queuename”);

This will return true only if the ticket is transferred TO queuename, it
will not trigger if it is transferred away from queuename

Attempt #2

return($transaction->Type = “Set” && $transaction->Field = “Queue” &&
$transaction->NewValue eq “queuename”);

Same result as attempt #1 (How can this be?)

I’ve done other attempts but still in vain.

This should really be trivial as I’m used to toying with RT conditions and
actions but I somehow can’t figure this one out.

On 10-09-20 1:27 PM, Kenneth Marshall wrote:

Hi David,

If there is not an alternative in the wiki, it probably does not
exist. (yet) At a first glance, I do not know how you would do
it without triggering on every queue change, whether the functionality
were built-in or not. In any case, the queue change action should be
much less frequent than many other actions so the impact should not
be too bad. YMMV

Regards,
Ken

On 10-09-20 1:21 PM, Kenneth Marshall wrote:

You need to have a global scrip that check for a queue change
and if the previous queue was the queue that you want to track
or react to exits.

Cheers,
Ken

On Mon, Sep 20, 2010 at 01:19:32PM -0400, David Moreau Simard wrote:

Hi,

We’re running RT 3.8.8 and we need to fire a scrip when a ticket is
transferred away from a queue (to any possible destination).

The condition built into RT “On queue change” only seems to fire when a
ticket is transferred in but not when a ticket is transferred out.

I’ve tried various possible workarounds in custom conditions and even
changing the stage of the transaction but to no avail.

Does anyone have a clue as to what kind of condition I could use to
trigger
my scrip when a ticket is transferred out ?
These possible conditions do not work:

my $transaction = $self->TransactionObj;
return($transaction->Type = “Set”&& $transaction->Field = “Queue”&&
$transaction->OldValue eq “queuename”);
return($transaction->Type = “Set”&& $transaction->Field = “Queue”&&
$transaction->NewValue ne “queuename”);

Thanks,

  • David

RT Training in Washington DC, USA on Oct 25& 26 2010
Last one this year – Learn how to get the most out of RT!

RT Training in Washington DC, USA on Oct 25 & 26 2010
Last one this year – Learn how to get the most out of RT!

I had to re-type part of the code to post it to the mailing list and
the $Transaction / $transaction came from there, it is actually fine in
the custom condition:

my $Transaction = $self->TransactionObj;

return($Transaction->Type eq “Set” && $Transaction->Field eq “Queue” &&
$Transaction->OldValue eq “queuename”);

It could had been a nice find though…

My error logs do not show anything relevant, no compilation errors or
anything.

David,

Maybe it’s just the way the typing looks, but it looks like you
defined my
$Transaction with a capitol “T”, but when you specify it in the code,
it has

David,

I could be wrong, but I think it is a matter of timing. My experience with
trying to stop a transaction in RT is that you’re always a little late in
the process. Once RT has recorded that a ticket has changed Queues, I
believe it is already too late. You can change it back, but you can’t stop
it. My advice would be to check the transaction for a Queue change
FROMthe Queue you don’t want to change from and just change it back.
We had a situation where someone was sending emails to a group when they
didn’t know where to send it. We wrote a scrip for that Queue that looked at
the from email address and just sent the ticket to the correct Queue.
Sorry I can’t be of more help.

KennOn Tue, Sep 21, 2010 at 8:05 AM, David Moreau Simard fooraide@gmail.comwrote:

I had to re-type part of the code to post it to the mailing list and the
$Transaction / $transaction came from there, it is actually fine in the
custom condition:

my $Transaction = $self->TransactionObj;

return($Transaction->Type eq “Set” && $Transaction->Field eq “Queue” &&
$Transaction->OldValue eq “queuename”);

It could had been a nice find though…

My error logs do not show anything relevant, no compilation errors or
anything.

David,

Maybe it’s just the way the typing looks, but it looks like you defined
my
$Transaction with a capitol “T”, but when you specify it in the code, it
has
a lowercase “t”. This might cause a problem. What did you see in your log
file?

Kenn
LBNL

RT Training in Washington DC, USA on Oct 25 & 26 2010
Last one this year – Learn how to get the most out of RT!