Zammad Ticket Automation: Building Custom Triggers, Webhooks, and Macros for Your Support Workflow
Every support team hits the same wall. Tickets pile up, agents spend half their day routing emails to the right queue, and somehow a high-priority issue from your biggest client sits untouched for six hours because nobody saw it. You don't need more agents. You need Zammad's automation engine working for you.
Zammad is an open-source helpdesk platform that handles email, chat, phone, and social media tickets in one place. But the real power isn't the inbox. It's what happens before your team even touches a ticket: triggers, webhooks, and macros that route, escalate, and respond automatically.
Let's build a real automation workflow from scratch.
Triggers: Your Always-On Rules Engine
Triggers in Zammad fire automatically when a ticket matches specific conditions. They consist of three parts: an activator (when to check), conditions (what to match), and actions (what to change).
There are two activator types you'll care about:
- Action-based: Fires whenever a ticket is created or updated. Think of it as event-driven.
- Time-based: Fires when a time condition is met. Perfect for SLA escalations.
Auto-Prioritize VIP Customers
Here's a practical example. You want tickets from your enterprise customers to automatically get high priority and land in a dedicated queue:
Trigger: VIP Customer Routing
- Activator: Action-based (ticket creation)
- Condition: Customer organization contains "Enterprise"
- Actions:
- Set priority to "3 high"
- Set group to "Enterprise Support"
- Add tag "vip"
In the Zammad admin panel, navigate to Manage > Triggers > New Trigger and configure it. The conditions support AND/OR logic, so you can combine multiple attributes like organization, email domain, or custom fields.
SLA Escalation Before It's Too Late
Time-based triggers are where things get interesting. Instead of waiting for an SLA breach, you can escalate proactively:
Trigger: Pre-SLA Warning
- Activator: Time-based (SLA warning reached)
- Condition: Priority is "3 high" AND state is "open"
- Actions:
- Set owner to team lead agent
- Send email notification to group managers
- Add internal note: "SLA warning reached, escalated to team lead"
One thing to know: triggers execute in alphabetical order by name. If you have triggers that depend on each other, prefix them with numbers (e.g., "01-Route VIP", "02-Escalate VIP") to control execution order.
Webhooks: Connecting Zammad to Everything Else
Triggers handle internal automation. Webhooks push ticket data to external systems. Since Zammad 6.0, you get both regular and pre-defined webhooks with fully customizable payloads.
Setting Up a Webhook
Navigate to Manage > Webhooks > New Webhook and configure:
- Endpoint URL: Where Zammad sends the POST request
- SSL verification: Keep enabled (disable only for testing)
- Custom payload: Define exactly what data gets sent
The default payload includes the full ticket object, articles, and user data. But you can customize it with variable interpolation:
{
"event": "ticket_update",
"ticket_id": "#{ticket.id}",
"title": "#{ticket.title}",
"priority": "#{ticket.priority.name}",
"customer": "#{ticket.customer.fullname}",
"customer_email": "#{ticket.customer.email}",
"group": "#{ticket.group.name}",
"state": "#{ticket.state.name}",
"agent": "#{ticket.owner.fullname}"
}
Webhook + n8n: Auto-Categorize with AI
Here's a workflow I've seen teams deploy with great results. Zammad sends new tickets to n8n via webhook, n8n passes the content to an LLM, and the AI returns the appropriate category. n8n then updates the ticket via Zammad's REST API:
- Zammad trigger fires on ticket creation, calls webhook
- n8n webhook node receives the payload
- n8n AI node analyzes ticket content and returns a category
- n8n HTTP node calls Zammad API to update the ticket group
The Zammad REST API endpoint for updating a ticket:
curl -X PUT https://your-zammad.example.com/api/v1/tickets/{ticket_id} \
-H "Authorization: Token token=YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"group": "Billing Support"}'
This turns a manual triage process that takes minutes per ticket into something that happens in under two seconds.
Slack Notifications for Critical Tickets
Another common pattern: send a Slack message when a critical ticket arrives. Create a webhook pointing to your Slack incoming webhook URL with a custom payload:
{
"text": "Critical ticket from #{ticket.customer.fullname}: #{ticket.title}",
"channel": "#support-escalations"
}
Attach this webhook to a trigger that matches priority "3 high" tickets, and your team gets instant visibility without checking the helpdesk dashboard.
Macros: One-Click Bulk Actions
While triggers are automatic, macros are manual shortcuts that agents execute with a single click. They're perfect for repetitive multi-step actions.
Common macro examples:
| Macro Name | Actions | Use Case |
|---|---|---|
| Close & Thank | Set state to "closed", send thank-you email template | Resolved tickets |
| Escalate to Engineering | Change group to "Engineering", set priority to high, add tag "escalated" | Bug reports |
| Spam & Block | Set state to "closed", add tag "spam", block sender | Spam tickets |
| Follow-Up Required | Set state to "pending reminder", set pending time to 48h | Waiting on customer |
Create macros in Manage > Macros > New Macro. Each macro can change multiple ticket attributes and send notifications in a single action.
Putting It All Together on Elestio
Deploying Zammad on Elestio takes about five minutes. Select Zammad from the marketplace, pick your provider (minimum 2 CPU / 4 GB RAM for a small team, 4 CPU / 8 GB RAM recommended for 10+ agents), and click Deploy.
Once running, here's a starter automation stack to configure:
- Trigger: Auto-assign tickets by customer organization
- Trigger: Time-based SLA escalation warnings
- Webhook: Push new tickets to n8n or Slack for AI categorization
- Macro: One-click "Escalate to Engineering" for agents
For custom domain setup with automated SSL, follow the official Elestio documentation.
Troubleshooting
Triggers not firing? Check alphabetical execution order. If trigger "B" depends on changes made by trigger "A", make sure "A" comes first alphabetically.
Webhook returning 4xx errors? Verify your endpoint URL accepts POST requests and that SSL verification settings match your server configuration. Check logs with:
docker-compose logs -f zammad-railsserver
Macros not visible to agents? Macros are group-scoped. Make sure the macro is assigned to the correct groups that your agents belong to.
Performance issues with many triggers? Keep trigger conditions specific. Broad conditions (like "any ticket update") will evaluate on every single change, which adds overhead on busy instances.
Zammad's automation engine is genuinely powerful once you understand how triggers, webhooks, and macros work together. Triggers handle the autopilot logic, webhooks connect your external tools, and macros give agents superpowers for the stuff that still needs a human touch.
Thanks for reading. See you in the next one.