Problem with CustomCondition

Hey,

i want to write a CustomCondition who activate a action if the queue is
changed from x to y

this is my code:

return 0 unless $self->TransactionObj->Type eq “Set”;
return 0 unless $self->TransactionObj->Field eq “Queue”;
return 0 unless $self->TransactionObj->NewValue == “y”;
return 0 unless $self->TransactionObj->OldValue == “x”;
return 1;

It does not work :frowning:

But when i delete the line
return 0 unless $self->TransactionObj->OldValue == “x”;
it is all OK - but now start the action, even if the old value is not “x”

Martin

View this message in context: http://www.nabble.com/Problem-with-CustomCondition-tp23827737p23827737.html

OldValue and NewValue are not strings, but numbers - queues’ IDs. Most
probably this is issue you’re facing. It’s not cleat from your
message.On Thu, Jun 4, 2009 at 10:22 AM, Martin B. mb@sla.de wrote:

Hey,

i want to write a CustomCondition who activate a action if the queue is
changed from x to y

this is my code:

return 0 unless $self->TransactionObj->Type eq “Set”;
return 0 unless $self->TransactionObj->Field eq “Queue”;
return 0 unless $self->TransactionObj->NewValue == “y”;
return 0 unless $self->TransactionObj->OldValue == “x”;
return 1;

It does not work :frowning:

But when i delete the line
return 0 unless $self->TransactionObj->OldValue == “x”;
it is all OK - but now start the action, even if the old value is not “x”

Martin


View this message in context: http://www.nabble.com/Problem-with-CustomCondition-tp23827737p23827737.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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

Best regards, Ruslan.