Create Tickets from Hashtag Actions in Ticket Notes
This tutorial walks through building a scheduled task that monitors Autotask ticket notes for a hashtag syntax (for example, #action) and automatically creates new tickets from each tagged entry. This lets technicians create follow-up tickets by simply adding structured notes to an existing ticket.
Overview
The workflow runs on a schedule and processes recently created ticket notes:
- Query Autotask for ticket notes created in the last few minutes that contain
#action - For each note, use a regex to extract the ticket title and description from the hashtag syntax
- Iterate over each match and create a new ticket for each one
- Link child tickets back to the parent by including the parent ticket number in the description
Example note syntax:
#action Order new monitors
Customer needs 3x 27" monitors for the conference room.
#action Schedule site visit
Need to do a site survey before the monitor install.
Each #action block becomes a separate ticket.
Related pages:
- Iterate Through Array
- Perform a Regular Expression Match
- API: Query for Object(s)
- API: Create an Object
Building the Scheduled Task
Create the Schedule
- In Email2AT, navigate to Scheduled Tasks
- Click Add New Scheduled Task
- Name it
Process Hashtag Actions - Set the cron schedule to run frequently, for example:
*/5 * * * *(every 5 minutes)
The cron runs in UTC. The polling query uses a date offset to find notes created since the last run. If you set the cron to every 5 minutes, query for notes created in the last 6 minutes to ensure no notes fall between runs.
Action 1: Query for Recent Ticket Notes
- Click Add New Action, select API: Query for Object(s), click OK
- Name the step
Find Notes with Hashtag Actions - Set Entity Type to
TicketNote - Add query conditions:
Descriptioncontains#actionCreateDateTimeis greater than{{date add="-6 minutes" to_tz="Autotask"}}
- In Store results in variable, enter
notes
Action 2: Iterate Over Each Note
- Click Add New Action, select Iterate Through Array, click OK
- Name the step
Process Each Note - Set Field to Iterate to
custom.notes - Set Value Variable Name to
note
Inside the iteration, add the following nested actions:
Nested Action A: Extract Hashtag Blocks
- Click Add New Action, select Perform a Regular Expression Match, click OK
- Name the step
Extract Action Blocks - Set Pattern to a regex that captures the title and description from each
#actionblock:
/#action\s+(.+?)(?:\n([\s\S]*?))?(?=#action|\z)/gi
This captures:
- Group 1: the title (text on the same line as
#action) - Group 2: the description (all text until the next
#actionor end of string)
- Set Input to
{{custom.note.description}} - Enable Return all matches
- In Store results in variable, enter
actions
Nested Action B: Iterate Over Each Action Block
- Click Add New Action, select Iterate Through Array, click OK
- Name the step
Create Ticket for Each Action - Set Field to Iterate to
custom.actions - Set Value Variable Name to
action
Inside this nested iteration, add:
Nested Action C: Create the Ticket
- Click Add New Action, select API: Create an Object, click OK
- Name the step
Create Action Ticket - Set Entity Type to
Ticket - Populate the required fields:
| Field | Value |
|---|---|
| AccountID | {{custom.note.ticketId.accountId}} (unlock the field; uses the parent ticket's account) |
| Status | New |
| Priority | {{custom.note.ticketId.priority}} (unlock the field; inherits from the parent ticket) |
| QueueID | {{custom.note.ticketId.queueId}} (unlock the field; inherits from the parent ticket) |
| Title | {{custom.action.[1]}} (the title captured from the hashtag line) |
| Description | Created from ticket {{custom.note.ticketId.ticketNumber}}\n\n{{custom.action.[2]}} |
The description includes the parent ticket number so technicians can trace back to the original ticket.
Linking Child Tickets to the Parent
The simplest approach is to include the parent ticket number in the child ticket's description, as shown above. This makes the relationship visible and searchable.
Test the Workflow
- Create a test ticket in Autotask
- Add a note to that ticket with the
#actionsyntax:
#action Test ticket creation
This is a test to verify the hashtag workflow.
- Run the scheduled task manually by clicking the Run button
- Open the processing log in History and verify:
- The note was found
- The regex extracted the correct title and description
- A new ticket was created with the expected fields
- Open the new ticket in Autotask and confirm the title, description, account, and parent ticket reference
Key Takeaways
- Polling window must overlap slightly: if the cron runs every 5 minutes, query for the last 6 minutes to avoid gaps
- Two levels of iteration: the outer loop processes each note, the inner loop processes each
#actionblock within the note - Include a queue or assigned resource: Autotask rejects tickets without at least a Queue or an assigned Resource and Role
- Parent ticket context is inherited: the child ticket's account, priority, and queue come from the parent ticket via the note's linked ticket properties
- Link back to the parent: include the parent ticket number in the child description for traceability
Related Documentation
- Iterate Through Array: looping over arrays
- Perform a Regular Expression Match: extracting data with regex
- API: Query for Object(s): querying multiple Autotask entities
- API: Create an Object: creating any Autotask entity
- Core Concepts: how rules, actions, and variables work together