Monitoring Alerts to the Right Autotask Account and Ticket
Monitoring tools such as Meraki, SentinelOne, Sophos, Webroot, PRTG, and Auvik send alerts from a no-reply address. When those emails reach Autotask's built-in email processor, it cannot tell which customer the alert is about, so the tickets land on a catch-all account. Every alert also becomes its own ticket, so one flapping device can bury your techs in tickets they have to move, merge, and close by hand.
This tutorial builds an automation that fixes both problems:
- Every alert lands on the right account. The automation reads the customer from the alert itself, not from the sender address.
- Related alerts stay together. While a device has an open ticket, new alerts for it are added to that ticket as notes instead of creating new tickets.
The ticket is created on the right account from the start. Nothing creates it in the wrong place and fixes it afterward, so a tech who grabs it right away sees correct information.
Email Processing is not a Meraki solution or a SentinelOne solution. It gives you building blocks (extract, look up, create, update, branch) that you arrange to fit your process. This tutorial shows one common arrangement. Once you see how the pieces fit, change any part of it: create a ticket for every alert, close tickets automatically, create a sales opportunity instead of a ticket, or ignore certain alerts entirely.
Decide What Should Happen
Before building anything, decide how you want alerts laid out in Autotask. Picture a device that goes down, comes back up, and goes down again. Do you want one ticket with several notes, or several tickets? Should the ticket close itself when the device recovers, or should a tech close it?
Here are the common choices:
| Approach | How it behaves |
|---|---|
| One ticket until a tech closes it (this tutorial) | The first alert creates a ticket. Every later alert for that device is added to the ticket as a note while it stays open. When a tech closes the ticket, the next alert starts a new one. |
| Also close automatically on recovery | Same as above, but a "device is back up" alert closes the ticket. See Optional: close the ticket automatically. |
| A separate ticket for every alert | Stop after Part 1. |
All three are valid designs. Choose the one that fits how your team works.
Before You Start
Prerequisites
- An Email2AT account with Autotask connected
- A monitoring tool that can send alert emails to an email address you choose
If you have not yet set up a mailbox, start with Create Your First Mailbox.
Create a dedicated Hosted Mailbox
- Navigate to Email2AT in the console and click Hosted Mailboxes
- Create a new mailbox, for example:
[email protected] - Click Save
- In your monitoring tool, set this address as the alert recipient
The mailbox is live as soon as you save it. Until you add rules, emails sent to it appear in History but nothing else happens.
We recommend giving every third-party system its own address. It keeps each tool's logic and History separate and tidy. There is no technical requirement to do this; you can also route alerts through your support mailbox and filter them with rule conditions.
Look at your alert emails
Open a few real alerts from your tool and find:
- The customer: a company name, organization or network name, site name, or other value that tells you which customer the alert is about
- The device: a device name, serial number, or other value that identifies the device
- The state, if you plan to auto-close: a word or phrase that tells a problem apart from a recovery, such as
downandup
This tutorial uses this simplified alert:
Subject: [Alert] Device SW-01 is down
Body: Company: Acme Corp
Device: SW-01
Status: down
Your tool's labels will be different. Adjust the extraction steps to match the labels in your emails.
Part 1: Create the Ticket on the Right Account
The first version takes three steps:
- Extract the company and device from the email
- Find the company in Autotask
- Create a ticket on that company
This alone puts every alert on the right account. Part 2 then adds the logic that keeps related alerts in one ticket.
Create the rule
- In your new mailbox, click Add New Rule
- Name it
Create or Update Alert Ticket - Leave the condition empty, so the rule runs for every email in this mailbox. You can add conditions later if some alerts need different handling.
Step 1: Extract the company and device
- Click Add Action, select Extract Strings, click OK
- Name the step
Extract Data from Email - Add two definitions:
| Variable | Extraction Type | Text | If Empty |
|---|---|---|---|
company_name | Text Expression | {{after_string email.body "Company:" flags="tn"}} | Generate an exception and stop processing |
device_id | Text Expression | {{after_string email.body "Device:" flags="tn"}} | Generate an exception and stop processing |
- In Store results in variable, enter
extracted
The after_string helper finds Company: in the email body and takes everything after it, up to the end of that line (n flag), with surrounding spaces trimmed (t flag). After this step, {{custom.extracted.company_name}} contains Acme Corp and {{custom.extracted.device_id}} contains SW-01.
If an email does not contain one of these labels, the automation stops and emails you an exception notice. You can then open the email in History and see what was different about it. That is safer than guessing at a customer.
Set Extraction Type to Regular Expression when the value is harder to pinpoint than "everything after this label." The pattern must have one capture group, for example /Company:\s*([^\n]+)/. See Extract Strings for details.
Step 2: Find the company in Autotask
- Click Add Action, select API: Query for One Object, click OK
- Name the step
Find Account - Set Entity Type to
Account - Add query conditions. Type
{in a value field to pick from the variables available, including the values you extracted in Step 1:AccountNameequals{{custom.extracted.company_name}}Activeequalstrue
- Enable Generate an exception if more than one result, so two similarly named accounts stop the automation instead of picking one at random
- In Store results in variable, enter
account
After this step, {{custom.account}} holds the whole account record, and {{custom.account.id}} is the ID Autotask uses for it.
Matching on the account name is the simplest approach. It works only when the name in the alert exactly matches the name in Autotask. See Identify the Customer for more reliable matching and for what to do when no account matches.
Step 3: Create the ticket
- Click Add Action, select API: Create an Object, click OK
- Name the step
Create Alert Ticket - Set Entity Type to
Ticket - Configure the fields:
| Field | Value |
|---|---|
| AccountID | {{custom.account.id}} (unlock the field to enter this) |
| Title | {{email.subject}} |
| Description | See below |
| Status | New |
| Priority | Medium, or whatever fits your alerts |
| QueueID | Your monitoring alerts queue |
- In Store results in variable, enter
ticket
Why unlock AccountID? When the field is locked, it is a picklist: you choose one account by name, and every ticket goes to that account. Behind the picklist, Autotask only receives the account's ID number. Unlocking the field lets you type a variable instead, so each alert sends the ID of the account found in Step 2.
Description. Build the description from any parts of the email or extracted values. End it with a bracketed device marker:
{{email.body}}
[Device ID: {{custom.extracted.device_id}}]
The marker ensures the device ID is on the ticket in a predictable format. Part 2 searches for it.
What you have so far
Step through what happens when an alert arrives:
- Step 1 pulls
Acme CorpandSW-01out of the email. - Step 2 finds the Acme Corp account in Autotask.
- Step 3 creates a ticket on Acme Corp, with
[Device ID: SW-01]at the end of the description.
Every alert now lands on the right account. If you want a separate ticket for every alert, you are done.
Part 2: Add Related Alerts to the Open Ticket
Now make repeat alerts for the same device go to the ticket that is already open.
To do that, each new alert has to tell the automation which ticket it belongs to. In this tutorial, that is the combination of the customer and the device: an open ticket on Acme Corp whose description contains [Device ID: SW-01]. We will refer to this tie between an email and its ticket as the correlation key. It is the value that is the same in every email about one problem and that the automation can also find on the ticket.
Step 4: Look for an open ticket
- Click Add Action, select API: Query for One Object, click OK
- Name the step
Find Open Ticket - Set Entity Type to
Ticket - Add these conditions to an All of these (AND) group:
AccountIDequals{{custom.account.id}}Statusdoes not equalComplete(or whatever your closed status is)Descriptioncontains[Device ID: {{custom.extracted.device_id}}]
- Leave Generate an exception if no results unchecked. Finding no ticket is normal; it means this is a new problem.
- Enable Generate an exception if more than one result. If two open tickets match, the automation stops so you can review them, instead of guessing which one to update.
- In Store results in variable, enter
ticket
Including the brackets in the search keeps SW-1 from matching a ticket for SW-10.
Step 5: Add a note or create the ticket
The Match action works like an if/then/else: it checks each branch's condition from top to bottom, runs the first branch that is true, and runs Default if none are.
- Click Add Action, select Match, click OK
- Name the step
Update or Create Ticket - Move the Create Alert Ticket step from Step 3 into the Default branch: select it, click Copy selected, click Paste in the Default branch's action list, then delete the original step
- Click Add Branch and set its condition to
custom.ticket.idis not empty - In that branch, add API: Create an Object with Entity Type
TicketNote, namedAdd Alert Note:
| Field | Value |
|---|---|
| TicketID | {{custom.ticket.id}} (unlock the field to enter this) |
| Title | {{email.subject}} |
| Description | {{email.body}} |
| NoteType | Task Summary, or your preferred note type |
| Publish | All Autotask Users or Internal Only |
The finished rule looks like this:
| Step | Action | What it does |
|---|---|---|
| 1 | Extract Strings | Pulls the company and device out of the email |
| 2 | API: Query for One Object | Finds the company's account |
| 3 | API: Query for One Object | Looks for an open ticket on that account for that device |
| 4 | Match, branch: custom.ticket.id is not empty | Adds the email to the open ticket as a note |
| Match, Default | Creates a new ticket |
What happens now
- First alert for SW-01: no open ticket is found, so Match runs Default and creates a ticket.
- More alerts for SW-01 while the ticket is open: the open ticket is found, so each alert becomes a note on it. No new tickets are created.
- A tech closes the ticket: the next alert for SW-01 finds no open ticket and starts a new one.
- An alert for a different device: it has a different device ID, so it gets its own ticket.
Optional: close the ticket automatically
To close the ticket when the device recovers, add two branches to the Match action, above the note branch. Branch order matters, because Match runs only the first branch that is true.
| Order | Condition | Actions |
|---|---|---|
| 1 | custom.ticket.id is not empty AND email.body contains Status: up | Add the note, then API: Update an Object to set the ticket's Status to Complete |
| 2 | email.body contains Status: up | No actions. A recovery with no open ticket has nothing to close, and an empty branch keeps Default from creating a ticket. |
| 3 | custom.ticket.id is not empty | Add the note (from Step 5) |
| Default | Create the ticket (from Step 3) |
Adding a note and closing the ticket take two separate actions because the Autotask API handles notes and status changes as separate calls. Use whatever text your tool uses for a recovery in place of Status: up.
Identify the Customer
Step 2 matched the account by name. That is the quickest way to get started, but it depends on the alert and Autotask using exactly the same name. Choose the approach that fits your data, then decide what happens when no account matches.
Option 1: Match the account name
This is the approach used in Step 2: AccountName equals the extracted company name. It works out of the box, but it breaks when the names differ even slightly (Acme Corp. in the alert versus Acme Corp in Autotask), or when someone later renames the account in Autotask.
Option 2: Match a field you control (recommended)
Create an account User-Defined Field (UDF) named after the monitoring tool, such as Meraki Organization Name. For each customer, enter the exact name your monitoring tool uses for them. Then change the Step 2 condition to:
UDF: Meraki Organization Nameequals{{custom.extracted.company_name}}
Now the two systems are linked by a value you control. Renaming an account in Autotask cannot break the automation, and the names do not have to match.
Option 3: Try both
To use the UDF where you have filled it in and fall back to the account name everywhere else, put both conditions in an Any of these (OR) group, inside the All of these (AND) group that checks Active:
UDF: Meraki Organization Nameequals{{custom.extracted.company_name}}AccountNameequals{{custom.extracted.company_name}}
This lets you start right away and fill in the UDF over time, only for customers whose names differ.
When no account matches
You choose how the automation handles an alert for a customer it cannot find:
| Choice | Setup | Result |
|---|---|---|
| Stop and notify | On the Find Account step, enable Generate an exception if no results | The automation stops and emails you an exception notice. No ticket is created until you fix the match and replay the email from History. |
| Use a default account | Leave Generate an exception if no results unchecked. Add a second API: Query for One Object right after it that finds your catch-all account (for example, AccountName equals Unknown Customer), stores its result in account, and has Only perform this action if set to custom.account.id is empty. | Every alert still becomes a ticket. Unmatched alerts land on your catch-all account, where a tech can move them. |
With Stop and notify, no alert is placed on the wrong account, but someone has to act on the exception. With Use a default account, no alert is held up, but some tickets need to be moved by hand. Consider adding the extracted company name to the ticket description, so the tech can see what the alert called the customer.
Instead of a dedicated catch-all account, you can use your zero account: skip the second lookup and enter {{#if custom.account.id}}{{custom.account.id}}{{else}}0{{/if}} in the unlocked AccountID field. It sends the found account's ID, or 0 when no account was found. Use the same expression for the AccountID condition in Step 4, so repeat alerts for an unmatched customer still find their ticket on the zero account.
Refinements
Use an alert ID instead of the device
Some tools include an ID that stays the same for every email about one alert, for example:
Alert ID: 9ca47b57-4c3f-8691-25e4-df3457b414d7
An alert ID is more specific than a device. If one device can have several problems at once, such as a disk alert and a CPU alert, the device marker groups them into one ticket. An alert ID gives each problem its own ticket.
To use it, extract the ID in Step 1, store it in the description marker in Step 3 ([Alert ID: {{custom.extracted.alert_id}}]), and search for that marker in Step 4. Set the extraction's If Empty to Generate an exception and stop processing, so an alert without an ID is not matched by guesswork. You can keep the device marker in the description too; it helps techs even though the automation no longer searches on it.
Make sure the recovery email repeats the original alert's ID. Some tools assign a new ID to the recovery event, which will not match the ticket.
You can store the marker in the ticket Title or in a dedicated ticket UDF instead of the description. Whichever field you choose, Step 4 must search that same field. Do not store it only in a note; the search looks at the ticket itself, not its notes.
Link Configuration Items
If you track devices as Configuration Items (CIs) in Autotask, you can look up the CI by device name (Entity Type InstalledProduct) and use it in two ways:
- To identify the customer: the CI's
AccountIDtells you the account, so you do not need a company name in the alert. - To link the ticket: set the ticket's
InstalledProductIDto the CI's ID, so techs see the device and its history.
Linking the CI is worthwhile even if you keep matching on the description marker. The Create Autotask Ticket (by Configuration Item) workflow action combines the CI lookup and ticket creation in one step.
Split the logic across rules
This tutorial keeps everything in one rule. You can split it, for example into an Extract Data rule followed by a Create or Update Ticket rule. If you do, store values that later rules need in global instead of custom. Email Processing resets custom when each rule finishes; global carries over to later rules for the same email. To switch, double-click the custom. prefix in the Store results in variable field. See Variables for details.
Test
- Send a test alert for a device. In History, open the details log and confirm that both values were extracted, the account was found, no open ticket was found, and a ticket was created on the right account with the device marker.
- Send a second alert for the same device. Confirm that it was added to the first ticket as a note and that no new ticket was created.
- Send an alert for a different device. Confirm that it created its own ticket.
- Close the first ticket in Autotask, then send another alert for that device. Confirm that a new ticket was created.
- Send an alert with a company name that does not exist in Autotask. Confirm that it follows the choice you made in When no account matches.
- If you set up auto-close, send a recovery alert. Confirm that the ticket received a note and closed. Send the recovery alert again and confirm that nothing changed and no ticket was created.
If a step fails or produces unexpected output, fix the rule and click the Play button on the history entry to reprocess the same email. You do not need to send a new test email for each iteration.
Handling Edge Cases
An alert is missing a value
If the company or device label is missing, the automation stops with an exception and emails you. Open the email in History, check whether your tool changed its format, and update the extraction.
Two open tickets match
The automation stops with an exception and changes neither ticket. Review the tickets in Autotask and merge or close the duplicate. If this happens often, the correlation key is not specific enough. For example, one device may have several separate problems open at once; consider using an alert ID.
Two accounts match
The automation stops with an exception. Use a UDF that you control to make the match exact.
Key Takeaways
- Read the customer from the alert, not the sender: extract it, find the account, and create the ticket on that account from the start
- Start simple: three steps (extract, find, create) put every alert on the right account
- Look for an open ticket first: the correlation key (here, account plus device marker) tells the automation which ticket an alert belongs to
- Use Match as an if/then/else: add a note when an open ticket exists; otherwise create one
- Match on a field you control: an account UDF is more reliable than an exact name match
- Decide what happens when no account matches: stop and notify, or use a default account
- Stop on ambiguity: enable the more-than-one-result exception instead of guessing
Related Documentation
- Core Concepts: the domain/mailbox/rule/action hierarchy
- Extract Strings: extract values with text expressions or regular expressions
- Match: run one branch of actions based on conditions
- Variables:
custom,global, and other variables - API: Query for One Object: query Autotask for a single result
- API: Create an Object: create any Autotask entity
- API: Update an Object: update any Autotask entity
- Expression Builder: build rule and step conditions
- Create Autotask Ticket (by Configuration Item): workflow action that handles CI lookup and ticket creation in one step
- UniFi Online/Offline Emails with Autotask: a video walkthrough of a similar pattern applied to UniFi devices
- PRTG Alerts with CI Association: the same idea using the Create Autotask Ticket by CI workflow action