[rt-users] Scrip needed that automaticaly closes tickets with a special subject

Gene LeDuc gleduc at mail.sdsu.edu
Mon Jul 16 11:42:53 EDT 2007


Hi Thomas,

Glad to hear your system is working the way you want.

Here are 2 ways to avoid the "your ticket has been resolved" 
notification.  Each affects a different group of tickets.

1.  This will turn it off for every resolved ticket in that queue: Create a 
new "On Resolve" scrip in the queue (use the same name as the Global scrip) 
and set the action to User Defined.  Then for the first action box in the 
scrip, just put
   return 0;
The scrip will trigger when a ticket gets resolved, but no action will ever 
be taken.

2.  This will affect just the tickets that are resolved by this particular 
scrip:  Replace the "$Ticket->SetStatus('resolved');" line in your scrip with
   $Ticket->_Set(Field => 'Status', Value => 'resolved', RecordTransaction 
=> 0);
This will prevent a transaction from being created when you change the 
status to 'resolved'.  No transaction, no notification.

Regards,
Gene

At 05:04 AM 7/16/2007, Thomas Hecker wrote:
>Hi all,
>
>ok so far, i got this scrip to work! Thanks everybody who helped.
>
>The last question is, how can i change the scrip to avoid sending a "your
>ticket has been closed" email?
>
>Best regards Thomas
>
>
>Am 12.07.2007 19:50 Uhr schrieb "Gene  LeDuc" unter <gleduc at mail.sdsu.edu>:
>
> > Hi Forrest,
> >
> > At 05:50 AM 7/12/2007, Forrest Blount wrote:
> >> I think you're going wrong in your custom condition.  The Transactions
> >> table doesn't have a subject field...
> >> I think what you want is more like:
> >> return($self->TransactionObj->Field eq "Subject" &&
> >>       $self->TransactionObj->NewValue eq "HMPF");
> >
> > The Transaction table of the database does not have a Subject field, but
> > $self->TransactionObj->Subject() is a method that returns the subject from
> > the transaction.  The conditions I gave in my original post will work if
> > the typos that were added are removed.
> >
> >> Thomas Hecker wrote:
> >>> But it still does not work. Here is what i did:
> >>>
> >>> Custom condition:
> >>> my $Transaction = $self->TransactionObj;
> >>> return $Transaction->$Transaction->Subject ='HMPF';
> >
> > Typo here.  Should be:
> > return $Transaction->Type eq 'Correspond' && $Transaction->Subject =~ 
> /HMPF/;
> >
> > Regards,
> > Gene
> >
> >
>
>
>_______________________________________________
>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


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




More information about the rt-users mailing list