[rt-users] Question on custom scrip condition

Ken Crocker kfcrocker at lbl.gov
Tue Jun 16 18:55:32 EDT 2009


Kevin,


Here's one we use for when the development step of a ticket (CF 
"Work-State") is changed to "Review Approved":

# condition execution on CF Review Process

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 => "Work-State");
     return 0 unless $cf->id; 
     if  ($trans->Field == $cf->id &&
          $trans->NewValue eq "Review Complete-Approved")
          {
           return 1;
          }
    }

return 0;

Just plug in your CF name and value you want and you're set. Hope this 
helps.

Kenn
LBNL

On 6/16/2009 2:53 PM, Kevin Gagel wrote:
> My users don't want to use priorities so they've had me create 4 
> levelsfor urgency. They only want to be notified by email on an item 
> that hasthe highest urgency level set. So I want to setup a custom 
> conditionthat tests for that level and then sends an email to the user 
> if thatspecific level is set.
>
> So, I have a custom field of "Urgency" which can have a value of 
> URGENT, High, Medium, Low, or Project.
> I have the template made already for the email to be sent out and 
> thescrip configured for it. I just don't know how to write the 
> customcondition to put into the scrip. How do I write the condition to 
> test for "URGENT" and indicate the action to send the email?
>
> All the references I'm finding in the RT Essentials have me a bit 
> confused, am I supposed to right a new module to make this scrip or 
> can I just add the perl code to the condition (not that I know what 
> code I have to enter just yet).
>
> Kevin W. Gagel
> Network Administrator
> Local 5448
> My blog:
> http://mail.cnc.bc.ca/blogs/gagel
> My shared files:
> http://mail.cnc.bc.ca/users/gagel
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> Buy a copy at http://rtbook.bestpractical.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090616/ab44f592/attachment.htm>


More information about the rt-users mailing list