Hey everyone! 👋 I was setting up SLA alerts in Freshservice for my team last week and thought I'd document the process. It's a powerful feature, but the configuration can be a bit nuanced if you want to go beyond the basics.
Here's a step-by-step breakdown of how I set up proactive email alerts for impending SLA breaches, including a custom workflow automator snippet.
**First, the core setup in Freshservice Admin panel:**
1. Go to **Service Delivery > SLA Policies** and edit your policy.
2. In the **"Notify"** section, you can set basic email alerts for breaches. But for *upcoming* breaches, you need workflow automator.
**Here's the more advanced part – a workflow automator rule to warn agents 1 hour before a Response SLA breaches:**
* **Trigger:** Ticket is "Created" or "Updated"
* **Condition:** Ticket SLA "Response Due By" is within the next 60 minutes AND Ticket Status is not "Resolved" or "Closed"
* **Action:** Send Email Notification (to Agent/Group)
You can set this up via the UI, but for clarity, here's the kind of logic you're implementing:
```json
// This is a conceptual representation of the workflow logic
{
"trigger": "ticket.update",
"conditions": {
"all": [
"sla_response.due_within": "60_minutes",
"ticket.status": {"not_in": ["Resolved", "Closed"]}
]
},
"actions": [
{
"action": "send_email",
"target": "ticket.agent",
"subject": "⚠️ SLA Response Deadline Approaching for {{ticket.id}}"
}
]
}
```
**A few pro-tips from my testing:**
* **Be specific with conditions** to avoid alert spam. Exclude resolved tickets like in the example above.
* Combine this with a separate, simpler rule for *actual* breaches (SLA Status = "Breached").
* Use placeholders like `{{ticket.id}}` and `{{ticket.subject}}` in your email templates for context.
* Remember, the "Due Within" condition checks from the *current time*, so the alert will fire on any update meeting the time window. Test this with a dummy ticket.
The built-in reporting is great for post-breach analysis, but these proactive alerts really help the team stay on top of things. Has anyone else set up similar alerts? I'd love to hear if you used different triggers or integrated it with a channel like Slack.
Happy coding!
Clean code, happy life
Nice! I always forget about using the "Updated" trigger alongside "Created" for these SLA workflows. Good call. That catches any tickets that might get stuck or reassigned after the initial creation.
A small gotcha I've hit with that condition: you need to be mindful of the "within the next 60 minutes" logic if your agents are in different time zones than your Freshservice instance. I once had alerts firing at weird hours because the workflow was using the instance's timezone, not the agent's. I ended up adding a time-based condition to only send during our support team's working hours to avoid the 3 AM emails 😅
Also, for anyone wanting to escalate beyond email, you can swap that "Send Email Notification" action for a webhook to post a message to a Teams/Slack channel. It adds a nice layer of urgency when the whole group sees it.
Integration Ian