Skip to main content

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:

  1. Query Autotask for ticket notes created in the last few minutes that contain #action
  2. For each note, use a regex to extract the ticket title and description from the hashtag syntax
  3. Iterate over each match and create a new ticket for each one
  4. 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:


Building the Scheduled Task

Create the Schedule

  1. In Email2AT, navigate to Scheduled Tasks
  2. Click Add New Scheduled Task
  3. Name it Process Hashtag Actions
  4. Set the cron schedule to run frequently, for example: */5 * * * * (every 5 minutes)
Timezone and polling window

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

  1. Click Add New Action, select API: Query for Object(s), click OK
  2. Name the step Find Notes with Hashtag Actions
  3. Set Entity Type to TicketNote
  4. Add query conditions:
    • Description contains #action
    • CreateDateTime is greater than {{date add="-6 minutes" to_tz="Autotask"}}
  5. In Store results in variable, enter notes

Action 2: Iterate Over Each Note

  1. Click Add New Action, select Iterate Through Array, click OK
  2. Name the step Process Each Note
  3. Set Field to Iterate to custom.notes
  4. Set Value Variable Name to note

Inside the iteration, add the following nested actions:

Nested Action A: Extract Hashtag Blocks

  1. Click Add New Action, select Perform a Regular Expression Match, click OK
  2. Name the step Extract Action Blocks
  3. Set Pattern to a regex that captures the title and description from each #action block:
/#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 #action or end of string)
  1. Set Input to {{custom.note.description}}
  2. Enable Return all matches
  3. In Store results in variable, enter actions

Nested Action B: Iterate Over Each Action Block

  1. Click Add New Action, select Iterate Through Array, click OK
  2. Name the step Create Ticket for Each Action
  3. Set Field to Iterate to custom.actions
  4. Set Value Variable Name to action

Inside this nested iteration, add:

Nested Action C: Create the Ticket

  1. Click Add New Action, select API: Create an Object, click OK
  2. Name the step Create Action Ticket
  3. Set Entity Type to Ticket
  4. Populate the required fields:
FieldValue
AccountID{{custom.note.ticketId.accountId}} (unlock the field; uses the parent ticket's account)
StatusNew
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)
DescriptionCreated 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

  1. Create a test ticket in Autotask
  2. Add a note to that ticket with the #action syntax:
#action Test ticket creation
This is a test to verify the hashtag workflow.
  1. Run the scheduled task manually by clicking the Run button
  2. 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
  3. 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 #action block 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