# Triggers and automations

> Let the desk do the routine work: tag, assign, answer and close tickets on their own, by rules you set.

Supportress has two kinds of rules. Both live in **Settings**, then **Automations**.

- A **trigger** runs the moment a ticket comes in or changes. For example: when the subject contains "refund", add the tag `refund` and set the priority to High.
- An **automation** runs on a clock. For example: close tickets that have been Solved for 4 days, or remind a customer when a Pending ticket has waited 3 days.

A rule only acts when **every** condition holds. Each time one runs, the ticket's history says so, with the rule's name.

## Make a trigger

1. Open **Settings**, then **Automations**, and press **Add a trigger**.
2. Give it a **Name**. It shows in each ticket's history when the trigger runs.
3. Pick when it **Runs**: when a ticket is created, when one is changed, or both.
4. Add the conditions, such as **Subject contains refund** or **Changed by the customer**.
5. Add what to do: set the status or priority, assign it, add or remove tags, reply to the customer, add an internal note, or email someone on the desk.
6. Press **Add trigger**.

Triggers run from the top of the list down. When one changes a ticket, the others look at it again, and each runs at most once for one change. Use **Move up** and **Move down** in a trigger's menu to change the order.

## Close solved tickets and remind customers

When you have no automations yet, Settings offers two to start from:

- **Close solved tickets after 4 days.** A closed ticket cannot be reopened. If the customer writes again, a new ticket opens.
- **Remind customers on pending tickets after 3 days.** It replies to the customer for you and adds the tag `reminded`.

Pick one, change the wording or the hours, and press **Add automation**. Supportress checks every few minutes. An automation runs once on each matching ticket, and again only after the ticket changes.

## Replies and emails from rules

A rule's reply is sent as your team, like any reply, and placeholders work as in macros, such as `{{customer.firstName | there}}`. To keep machines from answering each other, a rule never replies to spam, to automatic mail such as out-of-office messages, or to closed tickets. A rule's reply does not count as your first response.

**Email someone on the desk** sends a short email to the ticket's assignee, to your alert list (Settings, then Email), or to one address.

## Rules that undo each other

A ticket takes at most 10 rule runs in an hour. Two rules that keep undoing each other stop there, and the ticket's history shows every run, so you can see which rules to fix.

## Pause or remove a rule

Open the rule's menu and pick **Turn off** to pause it, or **Delete** to remove it. Tickets it already ran on keep their changes and their history.
