Automation rules
Automation rules run actions when tickets match triggers you define. Configure them in Settings → Routing & SLA, under Advanced, as a JSON array.
Available on Plus (up to 20 rules) and Enterprise (up to 25 rules).
Rule shape
Each rule is an object with:
| Field | Required | Description |
|---|---|---|
id | No | Stable identifier. If omitted, Ogma assigns one (rule-1, rule-2, …) when you save. |
enabled | No | Defaults to true. Disabled rules are ignored. |
name | No | Label shown in escalation reasons. Max 80 characters. Defaults to Rule 1, Rule 2, … |
trigger | Yes | When to evaluate this rule (see below). |
match | For message_contains | Case-insensitive text to look for in new customer messages. Max 200 characters. A message_contains rule without match never fires. |
ticketTypeId | No | If set, the rule only runs for tickets of that ticket type id. |
actions | Yes | One or more actions to run when the rule matches. |
Triggers
| Trigger | When it fires |
|---|---|
ticket_opened | A new ticket channel is created. |
ticket_escalated | A ticket is escalated to staff. |
message_contains | A customer posts a message in a ticket that contains match. Staff messages are ignored. |
customer_frustrated | Frustration detection flags a customer message. Needs frustration detection turned on in Settings → AI & voice. |
csat_negative | The customer submits a negative CSAT rating after close. |
sla_breach | A ticket misses its first-response SLA target. |
Actions
| Action | Effect |
|---|---|
{ "type": "add_tag", "tag": "billing" } | Adds a tag to the ticket (max 40 characters) and sends the ticket.tagged webhook. |
{ "type": "escalate" } | Escalates the ticket to staff and pauses bot replies. Does nothing if bot replies are already paused. |
{ "type": "assign_round_robin" } | Assigns the ticket using your Routing & SLA auto-assignment mode (round robin or load balanced). Does nothing if auto-assignment is off or set to manual. |
Each rule needs at least one valid action. Rules with an unknown trigger or no valid actions are dropped when you save.
Example
json
[
{
"id": "refund-escalate",
"enabled": true,
"name": "Escalate refund requests",
"trigger": "message_contains",
"match": "refund",
"ticketTypeId": "billing",
"actions": [
{ "type": "add_tag", "tag": "refund" },
{ "type": "escalate" }
]
},
{
"id": "assign-escalations",
"enabled": true,
"name": "Assign escalated tickets",
"trigger": "ticket_escalated",
"actions": [{ "type": "assign_round_robin" }]
},
{
"id": "tag-frustrated",
"name": "Tag frustrated customers",
"trigger": "customer_frustrated",
"actions": [{ "type": "add_tag", "tag": "frustrated" }]
}
]Paste a JSON array of rules into the editor, then save. Ogma validates and normalises the rules when it saves them.
Tips
- Turn on auto-assignment under Settings → Routing & SLA before using
assign_round_robin. New tickets are already assigned when auto-assignment is on, soassign_round_robinis most useful on later triggers such asticket_escalated. - Use
ticketTypeIdto scope noisy keyword rules to a single ticket type. - Escalation from a rule records the rule name in the escalation reason, so staff can see why it happened.
Related: Support ops · Settings · Tickets · Insights
