[rt-users] Question about On Queue Change Scrip Condition

2010-09-20 Thread David Moreau Simard

 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!


Re: [rt-users] Question about On Queue Change Scrip Condition

2010-09-20 Thread Kenneth Marshall
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!


Re: [rt-users] Question about On Queue Change Scrip Condition

2010-09-20 Thread David Moreau Simard
 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!


Re: [rt-users] Question about On Queue Change Scrip Condition

2010-09-20 Thread Kenneth Crocker
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

On Mon, Sep 20, 2010 at 12:53 PM, David Moreau Simard foora...@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!


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