如何在OTRS中重置工单响应并设置待办日期后的Escalations时间?
Alright, let's work through this OTRS escalation reset scenario you're facing. The core goal is: when you reply to a customer and set a specific pending date, the escalation clock resets, and triggers 1 full day after that pending date expires. Here's a step-by-step breakdown to make this work:
First, make sure you have a dedicated pending state for this workflow (or adjust an existing one):
- Go to
Admin > Statesin your OTRS backend. - Create a new state (e.g.,
Pending Customer - Awaiting Materials) or edit an existing pending state. - Set the State Type to
pending reminder(this tells OTRS it's a time-bound pending state). - Ensure EscalationStop is set to
Yes—this pauses escalation calculations while the ticket is in this pending state, so the clock doesn't tick down until the pending date passes.
You need to ensure when you set the pending date, the ticket's SolutionTime gets updated to pending date + 1 day. There are two reliable ways to do this:
Option A: Use a Custom Event Module (Automated, Global Behavior)
This will trigger automatically whenever a ticket is moved to your target pending state. Add this configuration to your OTRS system config (via Admin > System Configuration or directly in Kernel/Config.pm):
$Self->{'Ticket::EventModulePost'}->{'999_ResetEscalationPostPending'} = { Module => 'Kernel::System::Ticket::Event::TicketUpdate', Event => ['TicketStateUpdate', 'TicketPendingTimeUpdate'], Data => { # Only apply to your target pending state type StateType => ['pending reminder'], # Update SolutionTime to PendingUntil + 1 day (86400 seconds = 1 day) TicketUpdate => { SolutionTime => 'PendingUntil + 86400', }, }, Transaction => 1, };
After adding this, restart your OTRS web server to apply the changes.
Option B: Create a Macro (Manual, On-Demand Control)
If you prefer more control over when the reset happens, create a macro to run when replying to the customer:
- Go to
Admin > Macros. - Create a new macro (e.g.,
Reset Escalation After Pending). - Add an action: Update Ticket.
- Under the update fields, set
SolutionTimetoDynamic: PendingUntil + 86400. - Save the macro. Now, when you reply to a customer and set the pending date, you can run this macro to instantly reset the escalation time.
Double-check this critical system setting to ensure escalation pauses during the pending period:
- In
Admin > System Configuration, search forTicket::Escalation::StopOnPending. - Set it to
Yes—this ensures OTRS doesn't count the pending days against your escalation timeline.
To confirm everything works as expected:
- Create a test ticket and assign an initial solution time.
- Reply to the "customer" and set a pending date (e.g., 2 days from now).
- Check the ticket's details: the
SolutionTimeshould show as pending date + 1 day (e.g., 3 days from now). - Wait for the pending date to expire—OTRS should start counting down the 1-day escalation window, triggering the escalation exactly when that window ends.
内容的提问来源于stack exchange,提问作者cilap

