[rt-users] using custom field that applies to group as custom scrip condition

Ken Crocker kfcrocker at lbl.gov
Fri Mar 13 15:51:32 EDT 2009


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;
>>       }
>> }
>>     
>
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090313/da873865/attachment.htm>


More information about the rt-users mailing list