[rt-users] custom scrip, user-defined condition on custom field

Jens Porup jens at cyber.com.au
Wed Jul 7 22:53:52 EDT 2004


On Wed, Jul 07, 2004 at 08:57:54AM -0500, Bob Goldstein wrote:
> 
>   I recently wrote a Custom Scrip Condition for use with
>   Custom Fields.  It's fairly generic, you pass it an argument
>   saying which CustomField, and a bit 'o perl specifying how
>   to test the CF value(s).  So it can be re-used for any
>   transaction type, and any custom field test.
> 
>   If you like, I can send you the code.  And if it works for
>   you, I'll put it on the wiki.  (It's working for me,
>   using RT 3.2.0.  I think it would work on any 3.x.x)
> 
>      bobg
> 
Bob,

Does your code look something like this?

return undef unless ($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~ /matchtext/i);
return 1;

(from http://wiki.bestpractical.com/index.cgi?ExampleOfCustomFieldInCondition)

If you've got a different/better implementation, please do let me know!

Cheers,

Jens


> 
> >
> >G'day,
> >
> >I want to create a Custom Condition for a scrip based on a Custom Field 
> >set to a certain value.
> >
> >A search of the archive reveals this:
> >
> >	$self->TicketObj->QueueObj->Name()
> >
> >but 'perldoc Queue.pm' doesn't suggest the accessor method name to get 
> >the value of a custom field.
> >
> >So basically, in English, I want my custom condition to be:
> >
> >	If MyVariable equals ThisValue, then Notify etc
> >
> >Thanks,
> >
> >Jens
> >
> >
> >_______________________________________________
> >http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> >
> >Be sure to check out the RT wiki at http://wiki.bestpractical.com
> >
> >
> >
> >!DSPAM:40eb8b3c288621154936950!
> >
> >



More information about the rt-users mailing list