[rt-users] Override global scrip on ticket-by-ticket basis?

Gene LeDuc gleduc at mail.sdsu.edu
Fri Jan 25 16:25:11 EST 2008


Hi Sarah,

This should be pretty simple.  Create a "Select one value" custom field, 
say "SendResolutionMail" with 2 possible values: Yes and No.  Select this 
custom field in each queue that you want to be able to shut off the 
resolution e-mail.  Then have your resolvers select No in the ticket if 
they don't want an e-mail going out when the ticket gets resolved.

In your global resolve scrip, change the condition to User Defined and use 
the following as the condition:

{ ### True if (status changes to resolved) and (CF SendResolutionMail 
doesn't exist or exists and is Yes)
   my $switch = get_custom('SendResolutionMail');
   ### $sendit is true if the CF doesn't exist OR it exists and is 'Yes'
   my $sendit = ! $switch || $switch eq 'Yes'
   my $Transaction = $self->TransactionObj;
   my $val = $Transaction->Type eq 'Status'
          && $Transaction->NewValue eq 'resolved'
          && $sendit;
   return $val;

   ### Returns custom field value
   ### get_custom($field_name)
   sub get_custom {
     my $target_name = $_[0];
     my $val = $Ticket->FirstCustomFieldValue($target_name);
     return $val if defined $val;
     return undef;
   }
}

There are probably other ways to do this, but this should do what you want.

Regards,
Gene

At 12:02 PM 1/24/2008, Sarah Pomerantz wrote:
>My goal is to have a switch on the Resolve screen so a user can select
>whether or not the Resolved template is sent.
>
>Currently I have a global scrip "Resolve": On Resolve Notify
>Requestors and Ccs with template Resolved
>
>I see that you can write custom conditions for scrips 
>(http://wiki.bestpractical.com/view/WriteCustomCondition
>   , 
> http://www.gossamer-threads.com/lists/rt/users/12350?do=post_view_threaded
>   ).
>
>However these would not account for the case-by-case nature of this
>situation. I want to be able to skip the global scrip Resolve on a
>ticket-by-ticket basis, not queue by queue. Is this possible, ideally
>through a UI option on the Resolve screen?
>
>Thanks,
>Sarah Pomerantz
>sarah at bottlenose-wine.com


-- 
Gene LeDuc, GSEC
Security Analyst
San Diego State University 




More information about the rt-users mailing list