On a schedule
Track SLA risks and stuck tickets in a sheet
A sheet shows how long each open ticket has left before its deadline, Slack warns you before one breaches, and pending tickets get chased.
- Runs
- On a schedule
- Apps
- Google Sheets, Zendesk
- AI
- Not needed
- Access
- Zendesk agent; sheet editor
Send this to your assistant
Create a ClickRuntime automation: every 30 minutes, check open and pending Zendesk tickets. Update my SLA sheet with how long each has left, warn #support-leads about any due within an hour, and add a follow-up note to tickets pending for more than 3 days.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A support team promises a reply within four business hours. The lead keeps an eye on the queue, but between meetings and their own tickets, breaches still happen. Pending tickets are a quieter problem: they wait on the customer, nobody chases, and they sit open for weeks dragging down the numbers.
One sheet showing the time left on each ticket, plus a Slack warning shortly before a deadline, gives the team the chance to act. Pending tickets get a nudge so they either move forward or close.
What you get out of it
Warnings before the breach
An alert an hour ahead leaves time to reply, which a report on last week's breaches never does.
One view of the deadline queue
The sheet sorts tickets by time left, so anyone can see what is due next without building a Zendesk view.
Pending tickets do not rot
Tickets waiting on a customer get a follow-up after a few days, so they either move forward or can be closed.
Works without SLA policies
On plans without SLA features, ticket age is used instead, with the same warnings.
How it works
What happens, step by step
Every 30 minutes, ClickRuntime fetches open and pending tickets from Zendesk.
For each one it works out how long is left before the reply deadline you set.
Your SLA sheet is rewritten with every ticket and its time left, soonest first.
Tickets due within an hour are posted to your #support-leads Slack channel, once each.
Tickets pending for more than three days get a note asking the assignee to follow up.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect Zendesk
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Google Sheets and Zendesk steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from datetime import datetime, timezone, timedelta
from clickruntime import on_trigger, http, credentials, state, notify
ZD, AGENT = "https://yourcompany.zendesk.com/api/v2", "you@yourcompany.com"
def zd(method, path, **kw):
r = http.request(method, ZD + path, auth=(f"{AGENT}/token", credentials.secret("ZENDESK_API_TOKEN")), **kw)
return r.raise_for_status() or (r.json() if r.content else None)
sheets = lambda: build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
SHEET_ID = "your-spreadsheet-id"
TARGET = timedelta(hours=4)
@on_trigger
def run(event):
now, warned, rows, soon = datetime.now(timezone.utc), set(state.get("warned") or []), [], []
for t in zd("GET", "/search.json", params={"query": "type:ticket status:open status:pending"})["results"]:
age = now - datetime.fromisoformat(t["created_at"].replace("Z", "+00:00"))
left = round((TARGET - age).total_seconds() / 3600, 1)
rows.append([t["id"], t["subject"], t["status"], left])
if t["status"] == "open" and 0 < left <= 1 and t["id"] not in warned:
soon.append(f"• #{t['id']} {t['subject']} ({left}h left)")
warned.add(t["id"])
if t["status"] == "pending" and age > timedelta(days=3) and f"chased:{t['id']}" not in warned:
zd("PUT", f"/tickets/{t['id']}", json={"ticket": {"comment": {"body": "Pending 3+ days: please follow up with the customer.", "public": False}}})
warned.add(f"chased:{t['id']}")
sheets().values().update(spreadsheetId=SHEET_ID, range="SLA!A2", valueInputOption="RAW", body={"values": sorted(rows, key=lambda r: r[3])}).execute()
if soon:
notify.slack("Due within the hour:\n" + "\n".join(soon), channel="#support-leads")
state.set("warned", sorted(map(str, warned))[-3000:])
return {"tickets": len(rows), "warned": len(soon)}FAQ
Common questions
How is time left worked out?
Is the follow-up sent to the customer?
Will it warn about the same ticket repeatedly?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Keep a Google Sheet of your Zendesk tickets
A sheet lists your tickets with status, tags and dates, updated every hour, ready for reporting or building help articles.
See how it worksLog daily support numbers and churn signals to a sheet
Every day a row of ticket numbers goes into your metrics sheet, along with any customers whose tickets hint they might leave.
See how it worksCheck payment complaints against your payments sheet
Tickets about payments are matched to your payments sheet, and the genuine problems are raised to urgent and flagged in Slack.
See how it worksKeep exploring
Set up “Track SLA risks and stuck tickets in a sheet” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.