Paul,

Are yosaying it NEVER triggered? If so, then I suggest you look at your logs. Also, double check your values. Everything is case-sensitive. If the value you are checking for doesn't exist in the Custom Field EXACTLY as what you are checking for, it won't trigger. Otherwise, the code looks good. It should work. You did NOT put in the default Return 0; at the end. That should be there so that the scrip doesn't trigger if NONE of the conditions match. But that wouldn't keep it FROM triggering. I think it is a false value. Let me know.

Kenn
LBNL

On 3/13/2009 12:00 PM, Paul Vlaar wrote:
On Fri Mar 13 2009 19:58:17 GMT+0100 (CET), Paul Vlaar wrote:
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

if  ($trans->Type eq 'CustomField') {
      my $cf = new RT::CustomField($RT::SystemUser);
      $cf->LoadByName(Queue => $ticket->QueueObj->id, Name => "Contract");

      return 1 unless $cf->id;

This is actually a "return 0", but I had it set to 1 for debugging.

      if  ($trans->Field == $cf->id && $trans->NewValue eq "expiring") {
            return 1;
      }
}


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

Community help: http://wiki.bestpractical.com
Commercial support: [email protected]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Reply via email to