Macha

How to Automatically Populate Zendesk Ticket ID in a Custom Field

Abbas M

Written by

Abbas M

Last edited March 1, 2026

Zendesk Expert Reviewed

Verified

Learn how to automatically populate Zendesk ticket IDs into custom fields using webhooks and triggers. Complete guide with official documentation and step-by-step instructions.

How to Automatically Populate Zendesk Ticket ID in a Custom Field

Ever needed to copy your Zendesk ticket ID into a custom field right when the ticket is created? Maybe you're integrating with external reporting tools, creating custom reference numbers, or building workflows that require the ticket ID to be stored in a specific field. While Zendesk doesn't offer a built-in way to do this through standard triggers alone, there's a powerful workaround using webhooks and the Zendesk API.

In this guide, we'll walk you through exactly how to set up this automation so your ticket IDs populate automatically into any custom field you choose.

Understanding the Challenge

When a ticket is created in Zendesk, the system generates a unique ticket ID. However, this ID exists as a standard ticket property, not something you can directly copy into a custom field using regular trigger actions. This becomes a problem when you need to:

  • Store formatted ticket references (like "CHG00123" for change tickets)
  • Send ticket IDs to external systems that require them in specific fields
  • Create custom reporting that relies on having the ticket ID in a particular location
  • Meet business requirements for tracking or compliance

As one Zendesk user put it: "I have a business case related to some external reporting tools that requires this field."

The good news? With Zendesk's webhook functionality and the ticket API, you can make this happen automatically.

The Solution: Webhooks + Triggers + Placeholders

The approach involves three key components working together:

  1. A webhook that sends an API call back to Zendesk
  2. A trigger that activates when tickets are created
  3. Placeholders that dynamically insert the ticket ID

Here's how it works: When a ticket meets your trigger conditions, the trigger fires a webhook that makes an API call to update that same ticket's custom field with its own ID. Think of it as Zendesk talking to itself to update the ticket in ways that normal triggers can't.

Step-by-Step Setup Guide

Step 1: Create Your Custom Field

First, you'll need a custom field to store the ticket ID.

  1. In Admin Center, go to Objects and rules > Tickets > Fields
  2. Click Add field
  3. Select Text as the field type
  4. Enter a display name (for example, "Ticket Reference")
  5. Configure visibility settings based on your needs
  6. Save the field and note down its Field ID number (you'll need this later)

Step 2: Set Up the Webhook

Now you'll create a webhook that can update ticket fields using the Zendesk API.

  1. Navigate to Admin Center > Apps and integrations > Webhooks
  2. Click Create webhook
  3. Select Trigger or Automation as the connection method
  4. Enter a name like "Update Ticket Field"
  5. For the Endpoint URL, use: https://YOUR_SUBDOMAIN.zendesk.com/api/v2/tickets/{{ticket.id}}.json

Notice the {{ticket.id}} placeholder in the URL? Zendesk supports placeholders in webhook URLs that get dynamically replaced with actual ticket data when the webhook fires.

  1. Select PUT as the request method
  2. Select JSON as the request format
  3. For authentication, choose Basic authentication and enter your Zendesk credentials (email + API token)
  4. Click Create webhook

You can test the webhook by entering an existing ticket ID when prompted. Don't worry, the test won't actually modify data.

Step 3: Configure the Trigger

Now create a trigger that will fire your webhook when tickets are created.

  1. Go to Admin Center > Objects and rules > Business rules > Triggers
  2. Click Add trigger
  3. Name it something like "Populate Ticket ID on Creation"
  4. Set your conditions. For example:
    • Ticket: Is > Created
    • Add any other conditions if you only want this to work for specific ticket types
  5. Under Actions, select Notify active webhook
  6. Choose the webhook you just created
  7. In the JSON body field, paste this code:

json

{
 "ticket": {
   "custom_fields": [{
     "id": YOUR_CUSTOM_FIELD_ID,
     "value": "{{ticket.id}}"
   }]
 }
}

Replace YOUR_CUSTOM_FIELD_ID with the actual ID of your custom field from Step 1.

The {{ticket.id}} placeholder will be automatically populated with the actual ticket number when the trigger fires.

  1. Click Create

Important Note: When a trigger invokes a webhook, it queues the webhook job to be run but doesn't execute it immediately. This means there may be a slight delay (usually just seconds) between ticket creation and the field being populated.

Using Placeholders for Advanced Formatting

One of the powerful aspects of this approach is that you can use Zendesk's placeholder system to customize how data appears.

Want to add a prefix to your ticket ID? Simply modify the value in your JSON:

json

{
 "ticket": {
   "custom_fields": [{
     "id": YOUR_CUSTOM_FIELD_ID,
     "value": "CHG00{{ticket.id}}"
   }]
 }
}

This would turn ticket #12345 into "CHG0012345" in your custom field, perfect for creating change ticket references or other formatted identifiers.

You can use any of the available content placeholders to insert ticket data into your webhook requests, giving you flexibility to include other information like the ticket subject, requester details, or assignee information.

Verification and Testing

After setting everything up, test your workflow:

  1. Create a new test ticket that meets your trigger conditions
  2. Wait a few seconds for the webhook to process
  3. Open the ticket and check your custom field
  4. The ticket ID should now be populated automatically

If it's not working, double-check:

  • Your custom field ID is correct
  • The webhook authentication is properly configured
  • The trigger conditions are being met
  • You're using the correct API endpoint URL with your subdomain

Related Solutions You Might Need

Copying Other Ticket Data to Custom Fields

The same webhook approach works for copying any ticket data into custom fields. This method allows you to effectively copy required data into custom text fields without major API development work. You can adapt the JSON payload to include other placeholders like {{ticket.subject}}, {{ticket.description}}, or even data from related objects.

Updating Multiple Fields at Once

Need to populate several fields? Simply add more objects to the custom_fields array:

json

{
 "ticket": {
   "custom_fields": [
     {"id": 123456, "value": "{{ticket.id}}"},
     {"id": 789012, "value": "{{ticket.status}}"},
     {"id": 345678, "value": "{{ticket.priority}}"}
   ]
 }
}

Working with Dropdown and Multi-Select Fields

For dropdown fields, values must match the tag associated with each option. For multi-select fields, the value should be an array of tags. Make sure you're using the correct format based on your custom field type.

Important Considerations

Performance: Zendesk waits 10 seconds for webhook responses. If your webhook endpoint takes longer than 10 seconds to process the request, it will timeout. Since we're calling back to Zendesk itself, this typically isn't an issue, but it's good to be aware of.

Rate Limits: Be mindful that webhook-triggered API calls count toward your API rate limits. For most use cases, this won't be a problem, but if you're processing a high volume of tickets, keep this in mind.

Closed Tickets: Webhook-based updates only work on tickets that aren't closed, since closed tickets are read-only. Your old closed tickets will remain as-is.

Not Official Documentation: While this solution is widely used by Zendesk administrators and works reliably, it's worth noting that this specific workflow isn't documented as an official Zendesk feature. It's a clever use of existing tools that many Zendesk users have discovered and refined over time.

Wrapping Up

Populating ticket IDs into custom fields might seem like a simple requirement, but it requires thinking outside the box with Zendesk's automation tools. By combining webhooks, triggers, and the API, you can create powerful workflows that go beyond what standard triggers offer.

The beauty of this approach is its flexibility. Once you understand how to use webhooks to update tickets, you can apply the same technique to solve all sorts of automation challenges, from copying organization data to tickets, to creating complex approval workflows.

Have questions about implementing this in your Zendesk instance? The key is testing thoroughly in a sandbox environment first, then rolling it out to production once you're confident everything works as expected.

Additional Resources:

Tags: Zendesk automation, webhooks, custom fields, ticket management, API integration

About Macha AI

Macha AI builds purpose-built AI apps for Zendesk — including Copilot, Auto Reply, and Translations — designed to help agents work faster and smarter. And this is just the beginning. Many more apps are on the way. Learn more → getmacha.com

Zendesk
5.0 on Zendesk Marketplace

Loved by support teams worldwide

See what support teams are saying about Macha AI.

The application seems excellent to me! We are still testing, and we need support for some details and they were extremely efficient too!

Daniela Costa

Daniela Costa

Head of Support, Seabra

Macha has been a great addition to our support toolkit. It generates clear, well-organized responses that fit naturally into our workflow. One feature we particularly appreciate is its ability to automatically reply in the same language as the ticket.

Marius F

Marius F

Support Head, Zentana

We've been using Macha for a little while now and it's been really great addition so far! It's powerful, convenient, and makes getting work done a lot easier for our agents.

Alexander Wedén

Alexander Wedén

Head of Support

Support team is very helpful and responsive. Really enjoy how lightweight this is within Zendesk itself vs other more intrusive tools.

Cathleen Wright

Cathleen Wright

Zendesk Admin, Cortex IO

So far it's pretty good! Our queries are a little nuanced, so we can't always use it, but it's got enough utility for us. It can even incorporate our bilingual country with greetings in a second language.

Jae Oliver

Jae Oliver

Head of Support, Wise

Really enjoying using Macha, it has made a noticeable difference to our support team in a short amount of time. I really like the ticket summary feature, saves us a lot of time.

Harry Jackson

Harry Jackson

Head of Support, Crumb

Macha AI is a great addition to my workspace! It's powerful, convenient, and it really makes productivity so much easier for our agents!

Dave G

Dave G

Head of Support, Cyber Power Systems

Very impressed! AI integration for Zendesk has certainly come a long way and Macha seems to set the standard for now. This will for sure save lot of time in our support team.

Pauli Juel

Pauli Juel

Head of CS, Dokument24

Macha has been working great for us so far! The auto-responses are accurate and our resolution time has dropped significantly.

Lana T

Lana T

Zendesk Admin, Swotzy

Macha AI is a great addition. The knowledge base feature means our agents always have the right answers at their fingertips.

Mischa Wolf

Mischa Wolf

Head of Support, Topi

We're enjoying this integration so far. It's made our support team more efficient and our customers get faster responses.

Paula G

Paula G

Head of Customer Support, Xly Studio

The team enjoys using it. It saves considerable time on common questions and the integration options are excellent.

Kilian Leister

Kilian Leister

Support Head, Didriksons

Ready to supercharge your team with AI?

Get started in minutes. Connect your tools, configure your agents, and let AI handle the rest.