[rt-users] Scrip Question

Derek Buttineau derek at csolve.net
Wed Sep 24 10:42:22 EDT 2003


Please excuse me if this is a silly or repetitive question, but I'm 
trying to create a scrip that changes the owner to nobody on a ticket if 
a user corresponds back to the ticket..

I have the following setup, but nothing seems to be happening..

Condition: User Defined
Custom Condition:

if (($self->TransactionObj->Type eq "Correspond") and 
($self->TicketObj->OwnerObj->Id != $RT::Nobody->Id)) {
 return(1);
} else {
 return(undef);
}

Action: User Defined
Custom action prep:

    my $retval = undef;
    if ( defined( $self->TicketObj->OwnerObj->id ) ){
        if( $self->TicketObj->OwnerObj->Id != $RT::Nobody->Id ){
        $retval = 1;
        }
    }

Custom action cleanup:

my $retval = undef;
if ($self->TransactionObj->CreatorObj->Id != 
$self->TicketObj->OwnerObj->Id)
{
  $RT::Logger->info("Untake ticket");
  # They don't own the ticket.  Untake it.
  $retval = $self->TicketObj->SetOwner($RT::Nobody->Id);
}
   
return( $retval );

Template: Global template: Blank


Am I missing something?  Please enlighten :)

-- 
Regards,

Derek Buttineau
Internet Systems Administrator
Compu-SOLVE Internet Services





More information about the rt-users mailing list