Prompt
How do I track first response time and resolution time in a helpdesk?
Latest observation
To track first response time and resolution time in a helpdesk, define the events clearly, capture the right timestamps, and calculate the metrics consistently.
1) Define the metrics
First response time
Time from when a ticket is created/opened to when an agent first replies to the customer.
Common formula:
- First Response Time = first agent reply timestamp - ticket created timestamp
If you want it to reflect business hours only, use:
- Business First Response Time = first agent reply business time - ticket created business time
Resolution time
Time from when a ticket is created/opened to when it is resolved/closed.
Common formula:
- Resolution Time = ticket resolved timestamp - ticket created timestamp
Again, this can be measured in calendar time or business hours.
2) Capture the needed timestamps
For each ticket, store at least:
created_atfirst_agent_reply_atresolved_at- optionally
closed_at - status changes
- assignee/queue
- priority
- channel (email, chat, phone, web)
If a ticket is reopened, decide whether:
- resolution time resets, or
- you track original resolution time plus reopen cycles
3) Decide your rules
You need consistent rules for:
- What counts as a response?
- Usually only an agent reply, not an automated acknowledgment.
- What counts as resolved?
- Typically when the ticket is marked solved/resolved by the agent or customer.
- Do internal notes count?
- Usually no.
- Do replies outside business hours count?
- Choose calendar time or SLA/business time.
- How do you handle weekends/holidays?
- Exclude them if measuring SLA in business time.
4) Calculate the metrics
Example
- Ticket created: 9:00 AM
- First agent reply: 10:15 AM
- Resolved: 3:30 PM
Then:
- First response time = 1 hr 15 min
- Resolution time = 6 hr 30 min
5) Track them in reports
Useful views:
- Average first response time
- Median first response time
- Average resolution time
- SLA compliance rate
- Breakdown by:
- agent
- team
- priority
- channel
- customer segment
Median is often better than average because a few very old tickets can skew the average.
6) Example SQL logic
If your helpdesk stores ticket and message tables, something like:
SELECT
t.id,
t.created_at,
MIN(m.created_at) FILTER (WHERE m.author_type = 'agent') AS first_agent_reply_at,
t.resolved_at,
EXTRACT(EPOCH FROM (MIN(m.created_at) FILTER (WHERE m.author_type = 'agent') - t.created_at))/60 AS first_response_minutes,
EXTRACT(EPOCH FROM (t.resolved_at - t.created_at))/60 AS resolution_minutes
FROM tickets t
LEFT JOIN messages m ON m.ticket_id = t.id
GROUP BY t.id, t.created_at, t.resolved_at;
7) Best practices
- Exclude auto-replies from first response time
- Use timezone-aware timestamps
- Define whether SLA uses calendar or business hours
- Track reopened tickets separately
- Monitor by priority and channel
- Audit edge cases regularly
If you want, I can also show:
- how to do this in Excel/Google Sheets,
- how to implement it in SQL, or
- how to calculate business-hours SLA time.