Skip to main content

[Zendesk] Add AI Context to your attachment analysis trigger via SnapCall

J
Written by Jules Plantec

If you're already using SnapCall to extract data from attachments in Zendesk tickets, you can now guide the analysis with a custom AI prompt and inject real ticket context directly into it. This is done through the aiContext field in your webhook's JSON payload.

This means SnapCall's AI no longer just looks at the attachment in isolation. It can also see what the customer wrote in the ticket, so the extraction is more accurate and relevant to the actual request.


What is AI Context?

  • aiContext is an optional field that you can add to the JSON payload of the webhook that sends attachments to SnapCall.

  • It allows you to provide additional instructions and ticket information to the AI when an attachment is analyzed.

  • With aiContext, you can write a custom prompt that tells the AI exactly what to look for, what information to extract, or how it should behave during the analysis.

  • You can also include Zendesk placeholders in this prompt, such as the ticket title, description, latest customer comment, or any other relevant ticket field. These values are automatically pulled from Zendesk and sent to the AI together with the attachment.

In short: instead of the AI only seeing the attachment, it also sees the context the customer already gave you.

Example use cases

  • Cross-check the attachment against what the customer described in the ticket, and flag any mismatch.

  • Extract only the specific fields the customer mentions needing in their message.

  • Prioritize the parts of the document that are relevant to the complaint described in the ticket.


Prerequisite: the base setup

This feature builds on top of the standard attachment extraction setup (SnapCall integration connected to Zendesk, a webhook, and a trigger). If you haven't configured that yet, follow this article first: [Zendesk] Extract data from attachment in tickets via SnapCall.

Once that's in place, you just need to update the JSON payload on your existing trigger.


Add AI Context to Your Trigger

Open the trigger you created to call the SnapCall webhook, and update the JSON payload to include the aiContext field:

YOUR_PROMPT: your own instructions for the AI, written in plain text.

Example:

"Check if the attached document matches the issue described in the ticket."

You can combine your prompt with Zendesk placeholders inside the `aiContext` field and also use existing custom fields. Zendesk placeholders are dynamic values pulled directly from the ticket when the webhook is triggered.

They can include standard ticket information, such as the ticket title, description, or latest public comment, as well as values from custom ticket fields. This allows the AI to analyze the attachment with more context from Zendesk, instead of relying only on the uploaded media.

A few commonly used placeholders:

  • {{ticket.title}} — the ticket’s subject

  • {{ticket.description}} — the original ticket description

  • {{ticket.latest_public_comment_html}} — the most recent public comment on the ticket

  • {{ticket.ticket_field_123456789}} — the value of a specific custom ticket field

You can mix your prompt and placeholders freely in the same string. Zendesk will resolve the placeholders with the ticket's actual data before sending the payload to SnapCall.

For the full list of placeholders available in Zendesk, click View available placeholders at the bottom of the JSON editor when setting up your action.


Result

Once configured, every time a ticket with an attachment matches your trigger, SnapCall receives both the attachment and the resolved aiContext string, and uses it to inform its analysis. No extra action is needed from the customer or your agents.

Did this answer your question?