Skip to content

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.

Paste it into your assistant. It tells you what it will send or change before it runs live.

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

  1. Every 30 minutes, ClickRuntime fetches open and pending tickets from Zendesk.

  2. For each one it works out how long is left before the reply deadline you set.

  3. Your SLA sheet is rewritten with every ticket and its time left, soonest first.

  4. Tickets due within an hour are posted to your #support-leads Slack channel, once each.

  5. 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

RunsOn a schedule
Track SLA risks and stuck tickets in a sheettoday, 9:00Succeeded
Slack · #support-leadsDue within the hour: • #9122 SSO login loop for Acme staff (0.6h left)

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
sla_breach_and_pending_ticket_follow_up.pyexample
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?
From the SLA policy target on Zendesk Professional and above, or from the ticket's age against the limit you set on other plans.
Is the follow-up sent to the customer?
Only if you choose a public reply. By default it adds an internal note asking the assignee to chase, which is the safer starting point.
Will it warn about the same ticket repeatedly?
No. Each ticket triggers one warning per deadline.
What permissions does it need?
Zendesk agent; sheet editor. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (on a schedule). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

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.