This content is old, and possibly out of date.
We wanted to be able to close a ticket, without actually “closing” it. Thus the “pending” ticket status was born. We can set a ticket’s status as “pending”, and have it automatically marked as “closed” n days later, if there haven’t been any replies in that time.
I have received permission from my employer to release this under the GNU GPLv2.
Now that the background info is done with, here’s the solution I came up with to be able to have a soft resolution of tickets.
First up: Add the status itself to the list of inactive statuses, since supposedly the ticket is done with, or the requester just doesn’t care enough anymore to be bothered with replying to it.
Put the following in
You’ll then need to create
local/lib/RT/Action/AutoResolve.pm (I’d love to give credit on where I found the code that this is based on, but I can’t seem to find it on the RT Wiki anymore. If you can find the original, let me know so I can give proper credit for this) with the following content:
This will be used as the
--action argument to
local/lib/RT/Condition/UntouchedInDays.pm (Modified from UntouchedInHours.) for the
--condition used with
local/lib/RT/Search/PendingTicketsInQueue.pm will be used for the
--search. I can’t seem to find where I got this code from originally. If you recognize it, or are the original author, please let me know.
Now that the pre-requisites are in place, we can create the
rt-pending script that should be called daily to resolve tickets that have been set as pending for n days (in this example:
n = 7). I just dropped this script into
/etc/cron.daily/, but I’m using Debian. You should adjust as appropriate for your distribution.
That finishes up the portion to mark the tickets as resolved, after the given number of days have passed, with no updates to a ticket. Next up is re-opening the ticket if someone replies to it.
Now we’ll create the pre-requisites necessary to setup the queue, and global scrips relating to pending tickets.
local/lib/RT/Condition/ReplyToPending.pm, heavily based on ReplyToResolved.pm:
Now that these steps are done, you can create a global scrip with the condition set to
On Reply to Pending, and the action set to
Open Ticket. This will re-open any tickets as soon as someone replies to them, but not if anyone comments on them. (Commenting will, however delay the resolution of a ticket.)
You’ll then need to create either a global scrip, or a queue specific scrip for each queue where you want people to be able to reply to a pending ticket, and have it re-opened. (Personally I recommend the global scrip method.)
This step requires direct DB access. You’ll need to be able to do an insert on the
<user_id> should be replaced with a valid user ID, taken from one of the other entries in the
This sets up the “On Pending” scrip condition, so that you’ll be able to create a scrip such as “On Pending Reply to Requesters with template XXXXXX”, and have a custom message sent out to inform the requester that the ticket will close itself in n days, unless they reply to it.