[rt-users] Status changed from Resolved to Open during reply?

Kent drizit at gmail.com
Tue Oct 12 18:03:54 EDT 2004


On Tue, 12 Oct 2004 10:33:59 -0500, Kent <drizit at gmail.com> wrote:
> > On Mon, 11 Oct 2004 16:52:04 -0400, Jesse Vincent
> > <jesse at bestpractical.com> wrote:
> >
> > > Because you've got an "OnCorrespond, Open ticket" scrip. It's not done
> > > "in the user's process". It's done by the business logic.
> 
> In an effort to fix my logic I have copied AutoOpen.pm to my
> local/RT/Action directory and made the following changes to it listed
> below. I am trying to make it so a correspondence from the WebUI or
> Email does not re-open the ticket if CurrentUser=Owner.

I finally figured out the proper syntax for this. 
For all those interested here is the change to allow AutoOpen to NOT
open a resolved ticket if the person doing the update is the current
owner. You do need to restart apache after making the changes.

Thanks go to Ruslan and Jesse for pointing me in the right direction.

# {{{ sub Prepare
sub Prepare {
    my $self = shift;

    # if the ticket is already open or the ticket is new and the
message is more mail from the
    # requestor, don't reopen it.
    if ( ( $self->TicketObj->Status eq 'open' )
         || ( ( $self->TicketObj->Status eq 'new' )
              && $self->TransactionObj->IsInbound )
      ) {

        return undef;
-     } 
-     else {
-            return (1);
    }

+    #If status is resolved and actor is owner don't open.
+    if ( ( $self->TicketObj->Status eq 'resolved' )
+         && ( $self->TicketObj->OwnerObj->Name eq
&self->TransactionObj->CreatorObj->Name )
+      ) {
+       return undef;
+   }

+    #Nothing matched. Exit OK
+     return (1);
}
# }}}



More information about the rt-users mailing list