
Working with custom fields in Zendesk Messaging and AI Agents
In this article I'll explore how we can interact Widget metadata in AI Agents Advanced replies, and update custom fields when we escalate to an agent.
Context is king when it comes to providing good customer or employee support. When a customer is stuck on a checkout page, your AI Agent should be able to know that this is the most probable use case a customer is contacting you about. If they're looking at an order status page, the customer has a better experience if we pass that order number to the AI Agent or human agent instead of asking the customer to provide that context.
With the legacy Zendesk Bot we've been able to pass metadata to the bot, and this metadata would pre-fill custom fields you add as an ask for details step in Flow Builder. But with the arrival of the new AI Agents Advanced (née Ultimate), passing this data is handled a little bit differently.

Since AI Agents Advanced were developed outside of the Zendesk ecosystem and relies on Sunshine Conversations to pass data back and forth between channels like the web widget and integrations like your AI Agent or Agent Workspace, retrieving that data is not as easy as with the old Flow Builder. But with that added complexity comes a lot more use cases that weren't possible before, so in the end, we win a lot more than we loose.

My thanks to Cloudset for sponsoring Internal Note
In this article we'll handle the following scenarios:
- We'll pass context to the web widget to be used in a conversation
- We'll retrieve that context in our Bot Builder and use it in a reply
- We'll update and set data in our Bot Builder and pre-fill custom fields in Zendesk upon escalation.
Let's dive in.