Rule conditions and actions reference
Every field a rule can check, the operators each one offers, how matching works, and every action a rule can take.
On this page
This page lists what the rule editor offers under If, Then and Otherwise, in the order its menus show them. For how the parts fit together, see How rules work.
How matching works#
contains, starts with, ends with and the any of / all of operators on text ignore capital letters and match part of a word: "refund" matches "Refunded" and "refunds". Check short words such as "card" against real messages, since "card" also matches "discard".
is and is not on text compare the whole value exactly, capitals included. Email addresses, tags and sender addresses are the exception: they are always compared without regard to capitals.
contains any of and its relatives take a list. Type each value and press Enter.
is empty is true when a field has no value at all, or holds empty text.
Date conditions with … ago compare against the moment the rule runs. Rules run only when one of their events happens, so "Created is more than 3 days ago" is checked when the ticket next changes, not on the day it turns three days old.
Ticket#
| Field | What it checks | Operators |
|---|---|---|
| Ticket id | The ticket's number | number |
| External id | An id another system gave the ticket, through the API or an import | text value |
| Status | Open or Closed | choice |
| Priority | Low, Normal, High or Critical | choice |
| Channel | Where the ticket came in: Email, Chat, Contact form, Help center, SMS, Phone, API, Facebook, Messenger, Instagram comment, Instagram message or WhatsApp | choice |
| Created via | The route of the ticket's first message, such as email, api or helpdesk (started by an agent) | text value |
| Subject | The ticket's subject line | text |
| Language | The ticket's language as a two-letter code, such as en, when it is known | text value |
| Spam | Whether the ticket is marked as spam | yes or no |
| Started by an agent | Whether an agent, not the customer, opened the ticket | yes or no |
| Unread | Whether the ticket is unread | yes or no |
| Number of messages | How many messages the ticket has | number |
| Created, Updated, Opened, Closed | When the ticket was created, last changed, first opened by an agent, or closed | date |
| Last message | When the newest message arrived or was sent | date |
| Last message from the customer | When the customer last wrote | date |
| Last reply sent | When your team last replied | date |
| Snoozed until | When a snooze ends; empty if the ticket is not snoozed | date |
| Moved to trash | When the ticket was put in the trash | date |
| Assignee | The agent the ticket is assigned to | agent or team |
| Assignee email, Assignee name | That agent's email address or name | text value / text |
| Team | The team the ticket is assigned to | agent or team |
| Team name | That team's name | text |
| Tags | The tags on the ticket | list |
| Satisfaction score | The customer's survey rating, 1 to 5 | number |
Ticket fields and customer fields#
Each active ticket field has its own entry, listed by its name under Ticket fields, and each active customer field under Customer fields. The operators depend on the field's type:
| Field type | Behaves like |
|---|---|
| Dropdown | A choice field, with the field's own choices as values. It also offers is empty and is not empty |
| Text | A text value, without the list operators |
| Number | A number, without the list operators |
| Yes or no | Yes or no, plus the two empty checks |
| Date | A date with a calendar day; the "… ago" operators are not offered |
See Ticket fields and Customer fields.
Customer#
| Field | What it checks | Operators |
|---|---|---|
| Customer | The customer's id number | number |
| Customer email | The customer's main email address | text value |
| Customer name, Customer first name, Customer last name | The names on the customer's profile | text |
| Customer language | The language on the customer's profile, as a two-letter code | text value |
| Customer external id | An id from another system | text value |
Message#
Message fields read the message that started the run. For a new message, that is the message itself; for a new ticket, its first message; for an update, the newest message on the ticket.
| Field | What it checks | Operators |
|---|---|---|
| Message text | The message without the earlier emails quoted under it, when those can be told apart; otherwise the whole message | text |
| Message body | The whole message, quoted replies included | text |
| Message without quoted text | Only the new part of the message; empty when it cannot be separated | text |
| Message subject | The subject of this message | text |
| Message channel | The channel this message used, with the same choices as Channel | choice |
| Message sent via | The route this message took, such as email, api, helpdesk or rule | text value |
| Sent by an agent | Whether your team wrote the message | yes or no |
| Public (not an internal note) | Whether the customer can see the message | yes or no |
| Message sent | When the message was written | date |
| Message intents, Message sentiments | Labels attached to the message by the REST API or an import. The helpdesk does not add these to email or chat by itself | list |
| Sender address | The address the message came from | text value |
| Sender name | The name the sender gave | text |
| Recipient addresses | The addresses the message was sent to | list |
| Sender email | The email of the customer or agent who sent it | text value |
| Attachment names | The file names of attachments | list |
A few fields stay out of the menu unless a rule already uses them, usually one written as code or imported: Tag ids, Mailbox or channel integration, Message integration, Message id, Latest message preview and Message source type.
Operators#
The Operators column in the tables above names a kind of field. This table says which operators each kind offers and what they mean.
| Operator | True when | Offered for |
|---|---|---|
| is | The value equals what you enter | Every kind except lists |
| is not | The value differs from it, or the field is blank | Every kind except lists |
| is one of | The value equals any entry in your list | choice, text value, number, agent or team |
| is not one of | The value equals none of your entries | choice, text value, number, agent or team |
| contains | The text includes what you enter, anywhere | text, text value |
| does not contain | The text lacks it | text, text value |
| starts with | The text begins with it | text, text value |
| ends with | The text finishes with it | text, text value |
| contains any of | The text includes at least one of your words | text |
| contains all of | The text includes every one of your words | text |
| contains none of | The text includes no word from your list | text |
| does not contain all of | At least one of your words is missing | text |
| includes any of | The list, such as the ticket's tags, has at least one of your entries | list |
| includes all of | The list has every entry | list |
| includes none of | The list has no entry from yours | list |
| does not include all of | At least one of your entries is missing from the list | list |
| is more than, is at least | The number is above, or at least, yours | number |
| is less than, is at most | The number is below, or at most, yours | number |
| is after, is on or after | The date falls after, or on, the day you pick | date |
| is before, is on or before | The date falls before, or on, that day | date |
| is more than … ago | The date lies further back than the length you give, in minutes, hours, days or weeks | date |
| is at least … ago | The same, counting the exact length as a match | date |
| is less than … ago | The date is more recent than that length | date |
| is at most … ago | The same, counting the exact length as a match | date |
| is empty | The field has no value. Agent and team fields call it is not set | text, text value, number, date, agent or team, list |
| is not empty | The field has a value. Agent and team fields call it is set | text, text value, number, date, agent or team, list |
Yes-or-no fields offer only is and is not, with Yes or No.
Actions#
The same list appears under Then and Otherwise.
| Action | What you set | What it does |
|---|---|---|
| Add tags | One or more tag names | Adds the tags. A name that is not a tag yet is created |
| Remove tags | One or more tag names | Takes those tags off |
| Set status | Open or Closed | Opens or closes the ticket |
| Set priority | Low, Normal, High or Critical | Changes the priority |
| Assign to agent | An agent, or Nobody (unassign) | Assigns the ticket or removes its agent |
| Assign to team | A team, or No team | Assigns the team or removes it |
| Snooze | 1 hour, 4 hours, 1 day, 3 days, 1 week, or Custom length | Snoozes the ticket for that long |
| Apply a macro | A macro | Writes the macro's reply to the customer and makes its changes. An archived macro is skipped |
| Send a reply | The reply text, with Insert variable | Sends a reply on the ticket's channel, as Automation |
| Add an internal note | The note text, with Insert variable | Adds a note only your team sees |
| Set a ticket field | A ticket field and its value | Fills in the field, replacing its value |
| Change the subject | The new subject | Replaces the subject line |
| Skip the satisfaction survey | Nothing | The ticket gets no satisfaction survey when it closes |
Replies and notes go out before the other changes, so a rule that answers and then closes the ticket sends the answer first. When two actions change the same thing, the lower one wins. Variables in rule replies are listed in Variables in macros; the agent variables are left out, because no agent is involved.
Not available in rules#
These exist in some other helpdesks but not here: sending an email to an address outside the ticket, replacing all tags at once (use Remove tags and Add tags), setting a customer field, spreading tickets across several teams, moving a ticket to the trash, keeping a ticket out of automatic merging, conditions on business hours or holidays, conditions on Shopify order data, and actions on social media comments.
Related articles
- How rules workBuild a rule from When, If, Then and Otherwise, set the order rules run in, and find what a rule did on a ticket.
- Filters for views and searchEvery condition a view's filter can use, what each operator means, and how to combine conditions with all, any and groups.
- Variables in macrosEvery variable the macro editor offers, the store fields you can type yourself, and the filters that format dates and fill gaps.
- Ticket fieldsRecord facts on every ticket, such as the contact reason or the product, make some of them required before closing, and use them in rules, macros and views.
Still stuck?
Write to the Growth Dept team and a person answers. Say which helpdesk you work in and what you were trying to do.