[rt-users] Moving a ticket on deletion

Viren Patel virenp at mail.utexas.edu
Fri Jul 15 15:27:55 EDT 2005


Hello. I am using RT 3.2.3. I would like to create a scrip
to move a ticket from one queue  to another when the
ticket is deleted. So I created a custom scrip for the
originating queue as follows:

   Description: MoveOnDelete
   Condition:   User Defined
   Action:      User Defined
   Template:    Global template: Status Change
   Stage:       TransactionCreate

   Custom condition:
      if ( $self->TicketObj->Status eq 'Deleted' ) {
         return 1;
      } else {
         return 0;
      }

   Custom action preparation code:
      my ($status,$msg) = $self->TicketObj->SetQueue(
'Deleted' );
      unless ( $status ) {
         die "Error: $msg";
      }
      ($status, $msg) = $self->TicketObj->SetStatus( 'new' );
      unless ( $status ) {
         die "Error: $msg";
      }
      return 1;

   Custom action cleanup code:
      return 1;

While the ticket disappears from the originating queue, it
doesn't show up in the 'Deleted' queue. I have tried
interchanging the preparation code with the cleanup code
(I guess I don't understand the difference) but same
problem. Any pointers to what I am doing wrong? TIA.

Viren




More information about the rt-users mailing list