Automatically resolve Request Tracker ticket when moved into a queue
Context
- Request Tracker (RT) on help.mit.edu
Why might you want to do this?
This answer works best in combination with other automatic actions. The canonical example relates to RT queues that have been moved to a different ticket tracking system, such as ServiceNow. You may have a Scrip and Template in place to catch any tickets unintentionally moved into your queue, and automatically send them on to your new ticket tracking system.
However, now you're left with a new or open ticket in your queue. You can use the below Scrip to automatically resolve a ticket that was moved into your queue. The sequence doesn't really matter, unless your "move" template checks the ticket status, but you can set the stage to TransactionBatch to have the auto-resolve Scrip run at the end of the sequence.
Answer
Attaching the Scrip below to your queue will automatically change a ticket's status to "Resolved" when the ticket is moved into the queue, unless the status is already "Resolved".
Setting up the Scrip
You need to be an administrator for your RT queue to follow these instructions.
- Navigate to Tools > Configuration > Queues > Select
- Select your queue from the list of queues
- On your queue's configuration screens navigate to the Scrips tab (which is really a menu) and select Create
- Fill out the Create a Scrip... page as follows:
- Description: On Queue Change use Custom Action to Resolve
- Condition: On Queue Change
- Action: User Defined
- Template: Global Template: Blank
- Stage: TransactionBatch
- Custom condition: (Leave blank)
- Custom action preparation code:
if( $self->TicketObj->Status ne "resolved" ) { $self->TicketObj->SetStatus( "resolved" ); } return 1;
- Custom action cleanup code:
return 1;
- Click the Save Changes button to create your Scrip