Scan the Theme Support unassigned queue and My Unresolved Tickets in Zendesk
Scan Zendesk views to see what's in the Theme Support unassigned queue and your current unresolved tickets.
search_zendesk_tickets_by_advisor with [email protected] - no browser neededshopify.zendesk.com)chrome-devtools.json{"launchMode":"visible"}https://shopify.zendesk.com/agent/ and ask the user to sign inAlways use search_zendesk_tickets_by_advisor with advisor_email: [email protected] when checking Brendan's PQ. This avoids browser login issues and is faster.
| View | ID | URL |
|---|---|---|
| Theme Support | Unassigned | 4469570815501 | https://shopify.zendesk.com/agent/filters/4469570815501 |
| My Unresolved Tickets | 32208473 | https://shopify.zendesk.com/agent/filters/32208473 |
| Theme Support PQ Unresolved | 11227426874381 | https://shopify.zendesk.com/agent/filters/11227426874381 |
The Zendesk Views API is accessed via chrome_evaluate_script running fetch calls inside a page already authenticated with Zendesk. This piggybacks on the browser's session cookies (credentials: 'include').
GET /api/v2/views/{id}/tickets.json - List tickets in a viewGET /api/v2/views/{id}/count.json - Get ticket count for a viewGET /api/v2/tickets/{id}.json - Get ticket detailsGET /api/v2/tickets/{id}/comments.json?sort_order=desc&per_page=3 - Get recent commentsBefore querying, confirm Pi's browser is on a Zendesk page:
chrome_list_pages → look for a page on shopify.zendesk.com
If no Zendesk page exists, navigate to one:
chrome_navigate_page → https://shopify.zendesk.com/agent/
If the page redirects to Google sign-in, ask the user to log in via the visible browser window.
Use chrome_evaluate_script to fetch tickets from each view. Example for both views at once:
async function() {
const views = {
'Theme Support | Unassigned': 4469570815501,
'My Unresolved Tickets': 32208473,
'Theme Support PQ Unresolved': 11227426874381
};
const results = {};
for (const [name, viewId] of Object.entries(views)) {
const resp = await fetch(`/api/v2/views/${viewId}/tickets.json`, { credentials: 'include' });
const data = await resp.json();
results[name] = {
count: data.tickets?.length || 0,
tickets: data.tickets?.map(t => ({
id: t.id,
subject: t.subject,
status: t.status,
created_at: t.created_at,
updated_at: t.updated_at,
requester_id: t.requester_id,
tags: t.tags
}))
};
}
return results;
}
For each ticket, fetch the latest comments to get context on what the merchant needs:
async function(ticketId) {
const [ticketResp, commResp] = await Promise.all([
fetch(`/api/v2/tickets/${ticketId}.json`, { credentials: 'include' }),
fetch(`/api/v2/tickets/${ticketId}/comments.json?sort_order=desc&per_page=3`, { credentials: 'include' })
]);
const ticket = (await ticketResp.json()).ticket;
const comments = (await commResp.json()).comments;
const lastPublic = comments?.find(c => c.public);
return {
id: ticket.id,
subject: ticket.subject,
status: ticket.status,
created: ticket.created_at,
updated: ticket.updated_at,
priority: ticket.priority,
description: lastPublic?.plain_body?.substring(0, 300),
tags: ticket.tags
};
}
Present results as a clear summary table:
| # | Ticket | Merchant | Age | Key Tags |
|---|
| # | Ticket | Status | Last Updated | Key Tags |
|---|
next_page in the response for additional pages.credentials: 'include' option is required to use the browser's session cookies./skill:start-ticket to pick up tickets directly from the queue