Populate Ticket Details From a Ticket Number
Build a form where the visitor enters a ticket number and the form fills in the ticket's title, company, and contact. The visitor confirms they are updating the right ticket before they add their note, and your actions receive the ticket details without a second lookup.
Overview
| Piece | Purpose |
|---|---|
ticket_number field | The number the visitor types. |
Look up ticket workflow | Queries Autotask for the ticket with that number. |
ticket_title, company_name, contact_name fields | Calculated. Confirm the matched ticket back to the visitor. |
note field | The update the visitor wants to add. |
Related pages:
Before You Start
- Connect Autotask. See Autotask Connections.
- Create a form and give it a name. See Forms.
Step 1: Add the Visitor's Fields
Select the Input tab and add two fields.
| Field | Value |
|---|---|
| Name | ticket_number |
| Label | Ticket number |
| Type | String |
| Required | Checked |
| Description | Enter the ticket number from your confirmation email, such as T20260101.0001. |
| Field | Value |
|---|---|
| Name | note |
| Label | What would you like to add? |
| Type | Textarea |
| Required | Checked |
Step 2: Create the Lookup Workflow
Select the Pre-Submission Workflows tab, then select Add Workflow.
| Field | Value |
|---|---|
| Name | Look up ticket |
| Run this workflow on | Field change |
| Recalculate when these fields change | ticket_number |
Select Add Action and add API: Query for One Object.
| Setting | Value |
|---|---|
| Store the results in variable | ticket |
| Autotask Entity Type to Query | Ticket |
| Query condition | TicketNumber equals {{input.ticket_number}} |
Select Save Workflow.
The query returns the ticket together with its linked entities, so properties such as custom.ticket.Title, custom.ticket.Account.AccountName, and custom.ticket.Contact.FirstName become available.
Step 3: Add the Confirmation Fields
Return to the Input tab and add three calculated fields. Each one uses Type String with Populate this field with a Pre-Submission Workflow output checked and Pre-Submission Workflow set to Look up ticket.
| Name | Label | Property |
|---|---|---|
ticket_title | Ticket | custom.ticket.Title |
company_name | Company | custom.ticket.Account.AccountName |
contact_name | Contact | custom.ticket.Contact.FirstName |
Use the field row arrows to place these fields directly under ticket_number, so the visitor sees the confirmation before they write their note.
Step 4: Require a Match Before Submitting
Select the Advanced tab.
- Select Restrict submission with a condition.
- Set Submission behavior to Allow only if condition matches.
- Add a rule:
Workflow: Look up ticket / custom.ticket.idis not empty.
A visitor who mistypes the ticket number now sees "This form cannot be submitted with the current values." instead of creating an orphaned note. The empty confirmation fields show them why.
Step 5: Add the Note to the Ticket
Select the Actions tab and add the action that posts the update, such as API: Create an Object for a TicketNote. Reference the values you already have:
{{input.ticket_number}}{{input.note}}{{input.company_name}}
Save the form.
Step 6: Test It
- Open the public URL and enter a real ticket number.
- Click out of the field. The confirmation fields show "Calculating…", then the ticket details.
- Enter a note and submit.
- Enter a ticket number that does not exist. The confirmation fields stay blank and the form refuses the submission.
Next Steps
- Restrict the form to open tickets by adding a second query condition on
Status. - Verify the visitor's identity as well as the ticket number. See Verify a Ticket Secret Key.