|
| 1 | +--- |
| 2 | +displayed_sidebar: null |
| 3 | +description: Summarize Zendesk tickets with AI using a reusable Port MCP prompt (backed by self-service actions). Requires Port remote MCP installed and connected in your IDE. No AI agents or automations required. |
| 4 | +--- |
| 5 | + |
| 6 | +# Summarize Zendesk tickets with AI |
| 7 | + |
| 8 | +When working on support, you often need quick, structured summaries of a ticket for internal handoffs or customer updates. |
| 9 | +In this guide, we will set up a prompt in Port so that any AI tool that supports the prompt feature of the MCP protocol can help you summarize Zendesk tickets with all the relevant context. |
| 10 | + |
| 11 | +## Common use cases |
| 12 | + |
| 13 | +- Generate a concise, standardized ticket summary for internal handoffs. |
| 14 | +- Produce a customer-facing summary capturing request, resolution, and root cause. |
| 15 | +- Create quick recaps for weekly reviews or QA of support interactions. |
| 16 | + |
| 17 | +## Scenario |
| 18 | + |
| 19 | +You’re the on-call support engineer. A customer requests the ability to set labels for tickets on Zendesk ticket `4095`. Before hand-off, you need a concise internal summary and a customer-facing version. |
| 20 | + |
| 21 | +Example context snippets the prompt will fetch: |
| 22 | + |
| 23 | +```text |
| 24 | +Ticket subject: Add the ability to set labels for tickets |
| 25 | +
|
| 26 | +Recent comments |
| 27 | +- 2025-08-13 13:12: Customer: "I want the ability to set labels for tickets" |
| 28 | +- 2025-08-13 13:16: Agent: "Thanks for reaching out! Can you share a bit more about how you’d like to use these labels?" |
| 29 | +``` |
| 30 | + |
| 31 | +Example output from the prompt: |
| 32 | + |
| 33 | +<img src='/img/guides/analyzeZendeskTicketExample.png' border="1px" width="70%" /> |
| 34 | + |
| 35 | +## Flow overview |
| 36 | + |
| 37 | +<img src='/img/guides/analyzeZendeskTicketsFlow.jpg' border="1px" width="70%"/> |
| 38 | +<br/><br/> |
| 39 | + |
| 40 | +- Developer runs the reusable `zendesk_ticket_summary` prompt with `ticket_id` |
| 41 | +- Prompt uses actions to fetch comments and side conversations → returns a structured summary |
| 42 | + |
| 43 | +## Prerequisites |
| 44 | + |
| 45 | +- Port remote MCP installed and connected in your IDE (Cursor, Claude, etc.). Follow the setup guide: [Port MCP Server - Setup](/ai-agents/port-mcp-server#setup) |
| 46 | +- A Port account and have completed the [onboarding process](https://docs.port.io/getting-started/overview). |
| 47 | +- Custom integration to ingest Zendesk tickets using [Port webhooks](/build-your-software-catalog/custom-integration/webhook). |
| 48 | + |
| 49 | +## Add Secrets |
| 50 | + |
| 51 | +The actions in this guide authenticate to Zendesk using a secret that stores your API token, enabling them to retrieve ticket comments and side-conversation data. You can generate an API token by following Zendesk’s instructions [here](https://developer.zendesk.com/api-reference/introduction/security-and-auth/#api-token). |
| 52 | + |
| 53 | +To add the secret to your portal: |
| 54 | + |
| 55 | + 1. Click on the `...` button in the top right corner of your Port application. |
| 56 | + |
| 57 | + 2. Click on **Credentials**. |
| 58 | + |
| 59 | + 3. Click on the `Secrets` tab. |
| 60 | + |
| 61 | + 4. Click on `+ Secret` and add the following secrets: |
| 62 | + - `ZENDESK_TOKEN` - Your Zendesk API token generated according to the guide. |
| 63 | + |
| 64 | +## Set up self-service actions |
| 65 | + |
| 66 | +Zendesk tickets consist of two main sources: |
| 67 | + |
| 68 | +1. **Comments** – the primary conversation between the requester and agents (public or internal). |
| 69 | +2. **Side conversations** – separate threaded discussions (email, Slack, etc.) opened from the ticket for additional stakeholders. |
| 70 | + |
| 71 | +<img src='/img/guides/zendeskTicketExample.png' border="1px" width="100%" /> |
| 72 | + |
| 73 | + |
| 74 | +The self-service actions you’ll create below retrieve both comments and side-conversation messages, ensuring the prompt has the complete context before generating a summary. |
| 75 | + |
| 76 | +#### Get Ticket Comments |
| 77 | + |
| 78 | +This action fetches all comments for the Zendesk ticket identified by the entity identifier. |
| 79 | + |
| 80 | +1. Go to the [self-service](https://app.getport.io/self-serve) page of your portal. |
| 81 | +2. Click on `+ New Action`. |
| 82 | +3. Click on the `{...} Edit JSON` button. |
| 83 | +4. Copy and paste the following JSON configuration: |
| 84 | + |
| 85 | + <details> |
| 86 | + <summary><b>Action: Get Ticket Comments (Click to expand)</b></summary> |
| 87 | + |
| 88 | + ```json showLineNumbers |
| 89 | + { |
| 90 | + "identifier": "get_ticket_comments", |
| 91 | + "title": "get ticket comments", |
| 92 | + "trigger": { |
| 93 | + "type": "self-service", |
| 94 | + "operation": "DAY-2", |
| 95 | + "userInputs": { |
| 96 | + "properties": {}, |
| 97 | + "required": [], |
| 98 | + "order": [] |
| 99 | + }, |
| 100 | + "blueprintIdentifier": "zendesk_ticket" |
| 101 | + }, |
| 102 | + "invocationMethod": { |
| 103 | + "type": "WEBHOOK", |
| 104 | + "url": "https://<your_subdomain>.zendesk.com/api/v2/tickets/{{ .entity.identifier }}/comments", |
| 105 | + "agent": false, |
| 106 | + "synchronized": true, |
| 107 | + "method": "GET", |
| 108 | + "headers": { |
| 109 | + "Content-Type": "application/json", |
| 110 | + "Authorization": "Basic {{ .secrets.ZENDESK_TOKEN }}" |
| 111 | + }, |
| 112 | + "body": {} |
| 113 | + }, |
| 114 | + "requiredApproval": false |
| 115 | + } |
| 116 | + ``` |
| 117 | + |
| 118 | + </details> |
| 119 | + |
| 120 | +5. Click `Save`. |
| 121 | + |
| 122 | +#### Get Ticket Side Conversations |
| 123 | + |
| 124 | +This action lists all side conversations for the Zendesk ticket. |
| 125 | + |
| 126 | +1. Go to the [self-service](https://app.getport.io/self-serve) page of your portal. |
| 127 | +2. Click on `+ New Action`. |
| 128 | +3. Click on the `{...} Edit JSON` button. |
| 129 | +4. Copy and paste the following JSON configuration: |
| 130 | + |
| 131 | + <details> |
| 132 | + <summary><b>Action: Get Ticket Side Conversations (Click to expand)</b></summary> |
| 133 | + |
| 134 | + ```json showLineNumbers |
| 135 | + { |
| 136 | + "identifier": "get_ticket_side_conversation", |
| 137 | + "title": "get ticket side conversations", |
| 138 | + "trigger": { |
| 139 | + "type": "self-service", |
| 140 | + "operation": "DAY-2", |
| 141 | + "userInputs": { |
| 142 | + "properties": {}, |
| 143 | + "required": [], |
| 144 | + "order": [] |
| 145 | + }, |
| 146 | + "blueprintIdentifier": "zendesk_ticket" |
| 147 | + }, |
| 148 | + "invocationMethod": { |
| 149 | + "type": "WEBHOOK", |
| 150 | + "url": "https://<your_subdomain>.zendesk.com/api/v2/tickets/{{ .entity.identifier }}/side_conversations", |
| 151 | + "agent": false, |
| 152 | + "synchronized": true, |
| 153 | + "method": "GET", |
| 154 | + "headers": { |
| 155 | + "Content-Type": "application/json", |
| 156 | + "Authorization": "Basic {{ .secrets.ZENDESK_TOKEN }}" |
| 157 | + }, |
| 158 | + "body": {} |
| 159 | + }, |
| 160 | + "requiredApproval": false |
| 161 | + } |
| 162 | + ``` |
| 163 | + |
| 164 | + </details> |
| 165 | + |
| 166 | +5. Click `Save`. |
| 167 | + |
| 168 | +#### Get Side Conversation Messages |
| 169 | + |
| 170 | +This action retrieves the messages for a specific side conversation using its URL. |
| 171 | + |
| 172 | +1. Go to the [self-service](https://app.getport.io/self-serve) page of your portal. |
| 173 | +2. Click on `+ New Action`. |
| 174 | +3. Click on the `{...} Edit JSON` button. |
| 175 | +4. Copy and paste the following JSON configuration: |
| 176 | + |
| 177 | + <details> |
| 178 | + <summary><b>Action: Get Side Conversation Messages (Click to expand)</b></summary> |
| 179 | + |
| 180 | + ```json showLineNumbers |
| 181 | + { |
| 182 | + "identifier": "get_side_conversation_messages", |
| 183 | + "title": "get side conversation messages", |
| 184 | + "trigger": { |
| 185 | + "type": "self-service", |
| 186 | + "operation": "DAY-2", |
| 187 | + "userInputs": { |
| 188 | + "properties": { |
| 189 | + "side_conversation_url": { |
| 190 | + "type": "string", |
| 191 | + "title": "side conversation url", |
| 192 | + "format": "url" |
| 193 | + } |
| 194 | + }, |
| 195 | + "required": [ |
| 196 | + "side_conversation_url" |
| 197 | + ], |
| 198 | + "order": [ |
| 199 | + "side_conversation_url" |
| 200 | + ] |
| 201 | + } |
| 202 | + }, |
| 203 | + "invocationMethod": { |
| 204 | + "type": "WEBHOOK", |
| 205 | + "url": "{{ .inputs.side_conversation_url }}/events", |
| 206 | + "agent": false, |
| 207 | + "synchronized": true, |
| 208 | + "method": "GET", |
| 209 | + "headers": { |
| 210 | + "Content-Type": "application/json", |
| 211 | + "Authorization": "Basic {{ .secrets.ZENDESK_TOKEN }}" |
| 212 | + }, |
| 213 | + "body": {} |
| 214 | + }, |
| 215 | + "requiredApproval": false |
| 216 | + } |
| 217 | + ``` |
| 218 | + |
| 219 | + </details> |
| 220 | + |
| 221 | +5. Click `Save`. |
| 222 | + |
| 223 | +:::tip Subdomain flexibility |
| 224 | +Replace `<your_subdomain>` with your Zendesk subdomain, for example: `https://acme.zendesk.com/...`. |
| 225 | +::: |
| 226 | + |
| 227 | +## Create a reusable prompt |
| 228 | + |
| 229 | +We will now define a prompt entity that your IDE can invoke via [Port MCP](/ai-agents/port-mcp-server#prompts). Once created, you can run it with the ticket ID, and it will gather context and produce a structured summary. |
| 230 | + |
| 231 | +1. Go to the [Prompts page](https://app.getport.io/prompts) in Port. |
| 232 | +2. Click `Create prompt`. |
| 233 | +3. Toggle JSON mode. |
| 234 | +4. Paste the following JSON and adjust if needed. |
| 235 | + |
| 236 | + <details> |
| 237 | + <summary><b>Prompt entity: Zendesk Ticket Summary (Click to expand)</b></summary> |
| 238 | + |
| 239 | + ```json showLineNumbers |
| 240 | + { |
| 241 | + "identifier": "zendesk_ticket_summary", |
| 242 | + "title": "Zendesk Ticket Summary", |
| 243 | + "icon": "AI", |
| 244 | + "properties": { |
| 245 | + "description": "Summarize a Zendesk support ticket using comments and side conversations", |
| 246 | + "arguments": [ |
| 247 | + { |
| 248 | + "name": "ticket_id", |
| 249 | + "required": true, |
| 250 | + "description": "The Zendesk ticket ID to summarize" |
| 251 | + } |
| 252 | + ], |
| 253 | + "template": "You are an AI assistant tasked with summarizing Zendesk support tickets in Port. Use the comments and the side conversations on the ticket to summarize it in the following format:\n\n## Request\nWhat the customer wanted in a short sentence\n\n## Resolution \nWhat was the resolution\n\n## Root Cause\nIn case of a problem/bug, what was the root cause\n\n## Recommendations\nE.g., update docs, improve error messages, etc.\n\nInstructions for data gathering:\n- To get the comments and side conversations, send empty properties and use the entity identifier: {{ticket_id}}\n- To use the side conversations, you first need to get their URLs and then get the messages sent in them\n- No need to send an entity identifier for side conversation messages, only the side conversation URL in the properties\n\nTicket ID to analyze: {{ticket_id}}" |
| 254 | + }, |
| 255 | + "relations": {} |
| 256 | + } |
| 257 | + ``` |
| 258 | + |
| 259 | + </details> |
| 260 | + |
| 261 | +5. Click `Create`. |
| 262 | + |
| 263 | + |
| 264 | + |
| 265 | +### Test the workflow |
| 266 | + |
| 267 | +1. In Port, make sure there is a `zendesk_ticket` entity whose `identifier` matches a real Zendesk ticket ID you want to summarize. |
| 268 | +2. In your IDE assistant, choose **Port MCP** as the provider as described [here](/ai-agents/port-mcp-server#setup). |
| 269 | +3. Run the `zendesk_ticket_summary` prompt with `ticket_id` set to that Zendesk ticket ID. |
| 270 | +4. The assistant will automatically execute the self-service actions to fetch comments and side conversations, then return a structured summary. |
| 271 | + |
| 272 | +<img src='/img/guides/analyzeZendeskTicketsTest.gif' border="1px" width="100%" /> |
| 273 | + |
| 274 | +:::info Internal-only content |
| 275 | +Summaries can include sensitive customer or internal details, so treat them as internal documents. |
| 276 | +::: |
| 277 | + |
| 278 | +:::info Using Port MCP prompts |
| 279 | +For setup and capabilities, see the Port MCP Server prompts documentation: [Port MCP Server - Prompts](/ai-agents/port-mcp-server#prompts) |
| 280 | +::: |
| 281 | + |
| 282 | +## Best practices |
| 283 | + |
| 284 | +- Adjust the prompt to how you’d ideally want to receive a ticket summary—whether that’s a short bullet list or a detailed customer-facing recap. |
| 285 | +- Extend the prompt with specific preferences, such as ignoring non-informative system/autoresponder comments or highlighting key fields. |
| 286 | +- Use consistent formatting so summaries are scannable across tickets. |
| 287 | +- Consider variants: internal vs customer-facing tone; enforce English or match ticket locale. |
| 288 | + |
| 289 | + |
0 commit comments