> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neoagent.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Close Spam Tickets

> Close marketing emails, out-of-office replies and other junk tickets as they arrive, with an internal note that gives the reason

The **Spam Ticket Cleanup** template reads each new ticket and, when it is junk, sets a closed status. It never deletes a ticket or replies to the sender, and it leaves real support tickets as they are. A real request that Neo closes by mistake drops out of your queue, so most of the setup below is about what counts as junk and a test before the workflow goes live.

The template holds four actions: a ticket filter, **Ticket Triage** set to decide only the **Status** field, **Add Ticket Note** and **Update Ticket Fields**. It works on ConnectWise, Autotask, Halo, ServiceNow and Syncro.

## Setup

**1. Start from the template**

Open [**Spam Ticket Cleanup**](https://dashboard.neoagent.io/create?templateId=50). You can also go to [**Agents & Workflows**](https://dashboard.neoagent.io/) → **New** → **From a template** and pick it.

The builder opens on step 1, **Schedule/Select**, with **Triggered** selected and **Trigger When** set to **Ticket Created**.

**2. Limit it to the boards where email arrives**

The template's **Filter Tickets** section is empty, so as shipped Neo checks every new ticket. Click **Rule** and add the boards or queues where inbound email creates tickets. Leave out boards that only your technicians or your RMM create tickets on, such as alert boards.

To check only the tickets that look like junk, you can also add an `[AI] Ticket content is related to` rule with a topic such as `marketing email, newsletter or out-of-office reply`. Type a topic, not instructions: see [AI filters](https://docs.neoagent.io/core/filter-tickets.md#filters-that-search-for-text-you-type).

Click **Verify Rules** before you go on.

**3. Rewrite the junk instructions**

Click **Next**. Under **1. Smart Actions**, the **Ticket Triage** action has one row, **Status**. Click the settings icon on that row. **Use your own instructions** is on, and **Your instructions** holds the template's text:

```
Identify all emails labeled as marketing, spam, or out-of-office, and update their status field to 'completed'.
```

Replace it. Two changes stop most false positives:

* **Name your real closed status.** "completed" is a placeholder. Use the status name exactly as your PSA shows it. On ConnectWise each board has its own statuses, so name the closed status of every board in your filter.
* **Say what is not junk, and what to do with it.** Neo triages the status of every ticket the filter lets through, so tell it to leave real tickets alone.

For example:

```
Set the status to "Closed - Spam" only when the ticket is one of these:
- a marketing email or newsletter
- an automatic out-of-office or vacation reply
- cold sales outreach
For every other ticket, keep the current status.
A message from a client contact that asks for help is never junk,
even when it also holds an out-of-office line.
A user who forwards a suspicious email to report it needs help: keep that ticket open.
```

> [!WARNING]
>
> On ConnectWise, also turn on **Include closed/resolved statuses** in the same settings. Without it Neo only offers the open statuses of the ticket's board, so it cannot close any ticket. The template ships with this setting off. Autotask, Halo, ServiceNow and Syncro offer every status, closed ones included.

![Ticket Triage Status settings with Use your own instructions on, a rewritten spam instruction, and Include closed/resolved statuses on](https://mintcdn.com/neoagent/Ay3PPakIrk7J4Ca5/images/recipes/spam-status-settings.webp?fit=max\&auto=format\&n=Ay3PPakIrk7J4Ca5\&q=85\&s=ecf602c8c68b34865bda10d1991dec6d)

**4. Check what is written to the ticket**

**Ticket Triage** only decides the status. The two actions under **2. Update in PSA** act on it:

* **Add Ticket Note** posts Neo's reason as a note. **Type of note to add** is **Internal Note**, so the sender does not see it. A technician who finds a closed ticket can read why Neo closed it.
* **Update Ticket Fields** writes the status to the ticket.

**5. Test it before it closes anything**

Remove **Update Ticket Fields** from **2. Update in PSA**, then click **Save as Disabled**. Without that action, Neo decides and posts its note, but no status changes.

On [**Agents & Workflows**](https://dashboard.neoagent.io/), open the workflow's row menu and click **Run Now**. Under **Ticket IDs**, enter up to 20 recent tickets from the boards in your filter: some junk, and some real requests that look like junk, such as a client's reply with an out-of-office line. Under **Advanced**, turn on **Emulate as newly created ticket**, so Neo reads each ticket as it was when it arrived.

Read each result on [Executions](https://dashboard.neoagent.io/executions). When Neo would change the status, the result starts with "No change was written to the PSA", then gives the status Neo chose and why. If a real ticket would close, tighten the instructions and run the same tickets again.

**6. Turn it on**

Edit the workflow. Under **2. Update in PSA**, click **Add Action** and add **Update Ticket Fields** back after **Add Ticket Note**. Click **Save changes**, then click **Enable** in the workflow's row menu.

Check the first days of results on [Executions](https://dashboard.neoagent.io/executions). Each closed ticket also carries Neo's internal note.

## Variations

* **Park junk on a review board.** Under the field list, turn on **Move the ticket to a specific board/queue after triaging** and pick a board in **Board or queue**, such as "Junk - review". A technician can then review everything Neo closed in one place. On ConnectWise, Neo then picks the closed status from that board, so name that board's status in your instructions.
* **Clean up junk already in the queue.** A triggered workflow only sees new tickets. To run it on open tickets that arrived before you enabled it, start a [backfill](https://docs.neoagent.io/core/backfills.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.