Skip to content

Every 10 minutes

Turn support emails into Zendesk tickets and log them

Support emails arriving in Gmail become Zendesk tickets with a category, and each one is logged in a sheet.

Runs
Every 10 minutes
Apps
Google Sheets, Zendesk
AI
Optional
Access
Zendesk agent; sheet editor; Gmail read

Send this to your assistant

Create a ClickRuntime automation: every 10 minutes, take new emails in my Gmail with the label Support, create a Zendesk ticket for each with an AI-chosen category, and add a row to my Intake sheet.

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 small team handles support from a shared Gmail inbox but wants to move to Zendesk without switching the address customers already use. Forwarding rules lose the original sender, and nobody has time to copy emails across. The operations lead also wants a simple log of what came in and how it was categorised.

Creating tickets from the labelled emails keeps the customer-facing address unchanged, and the sheet gives a running record of every request.

What you get out of it

  • Keep your existing support address

    Customers carry on emailing the address they know; tickets appear in Zendesk behind the scenes.

  • Categories from the start

    Each ticket arrives tagged as billing, bug, question or feedback, so it lands with the right person.

  • A simple intake log

    The sheet shows every request with its date, sender and category, for anyone who wants to count or audit them.

  • No copying between tools

    Agents stop pasting emails into Zendesk by hand.

How it works

What happens, step by step

  1. Every 10 minutes, ClickRuntime looks for new emails in Gmail with the Support label.

  2. If AI is available, it reads each email and picks a category such as billing, bug or question.

  3. A Zendesk ticket is created with the sender as the requester and the category as a tag.

  4. A row with the date, sender, subject, category and ticket number is added to your Intake sheet.

  5. The email is marked as handled, so it is never turned into a ticket twice.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect Zendesk

What you get

RunsEvery 10 minutes
Turn support emails into Zendesk tickets and log themtoday, 9:00Succeeded
Google Sheets · Intake19 Oct 09:42 | Acme Ltd <accounts@acme.example> | Charged twice for October | billing | #9310

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

  • Act only on the items that match your own rules, and skip the rest
  • Change what the AI looks for, or how it writes the result
  • 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.
emails_to_zendesk_tickets_with_a_sheet_log.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, report_fetched, http, credentials, ai, state

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)

SHEET_ID = "your-spreadsheet-id"

def categorise(text):
    try: return ai.generate(text, system="One word: billing, bug, question or feedback.", max_output_tokens=5).text.strip().lower()
    except ai.AIError: return ""

@on_trigger
def run(event):
    creds = Credentials(credentials.connection("google", "work"))
    gmail = build("gmail", "v1", credentials=creds, cache_discovery=False).users()
    seen, rows = set(state.get("seen") or []), []
    ids = [m["id"] for m in gmail.messages().list(userId="me", q="label:support newer_than:1d").execute().get("messages", []) if m["id"] not in seen]
    report_fetched(len(ids))
    if not ids:
        return {"summary": "No new emails"}
    for mid in ids:
        h = {x["name"]: x["value"] for x in (m := gmail.messages().get(userId="me", id=mid, format="full").execute())["payload"]["headers"]}
        cat = categorise(f"{h['Subject']}\n{m['snippet']}")
        t = zd("POST", "/tickets", json={"ticket": {"subject": h["Subject"], "comment": {"body": m["snippet"]},
               "requester": {"email": h["From"].split("<")[-1].strip(">"), "name": h["From"].split("<")[0].strip()}, "tags": [cat] if cat else []}})["ticket"]
        rows.append([h["Date"], h["From"], h["Subject"], cat, t["id"]])
        seen.add(mid)
    build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Intake!A:E", valueInputOption="RAW", body={"values": rows}).execute()
    state.set("seen", sorted(seen)[-2000:])
    return {"tickets": len(rows)}

FAQ

Common questions

Does the customer become the ticket requester?
Yes. The ticket is created with the sender's name and email as the requester, so replies from Zendesk go straight to them.
Does it need AI to work?
No. Without AI, tickets are still created and logged; the category column is simply left for the agent to fill in.
Could Zendesk's own email channel do this?
Often, yes. This automation suits teams who want to keep the inbox in Gmail, add AI categories or keep a separate log in a sheet.
What permissions does it need?
Zendesk agent; sheet editor; Gmail read. Nothing else in your accounts is used.
Does it need AI?
No, but you can ask for an AI step (for example a summary). It then uses ClickRuntime's built-in AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new 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 “Turn support emails into Zendesk tickets and log them” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.