Sweep stale Zoho Desk tickets into Slack every weekday

Every weekday morning, find the Zoho Desk tickets nobody has touched in three days, post them to Slack grouped by owner, and log each one to a spreadsheet.

Deterministic Code
Zoho DeskSlack BotGoogle SheetsCustomer SupportOperationsDaily DigestsNotifications & Alerts
PromptCreate

Every weekday at 8am, sweep my Zoho Desk helpdesk for tickets that have gone stale and report them in one place so nothing sits forgotten. Run this on a cron schedule, Monday through Friday at 8am in my timezone.

Start by fetching open tickets from Zoho Desk using List Tickets. Two things about this API to handle properly. First, every Zoho Desk endpoint except the organizations lookup requires the orgId header, so resolve the organization id once at the start and send it on every call. Second, the list endpoints are offset paginated with a from parameter and a limit parameter, the limit maxes out at 50 on most list endpoints, and an empty result comes back as HTTP 204 with no body rather than an empty array. So page through with from and limit and keep going until a page returns fewer records than the limit or returns a 204. Do not assume one page is the whole queue.

Filter those tickets down to the stale ones: keep only tickets whose most recent modified time is three or more days before the moment the sweep runs. For each survivor, compute the age as a whole number of days since that last update, because I want that number shown in both outputs.

Resolve the owners. Call List Agents once, page it the same way, and build a lookup from agent id to agent name. Then map each stale ticket's assignee id to a readable agent name through that lookup. Do not make a separate agent call per ticket. Any ticket with no assignee id is treated as unassigned.

Group the stale tickets by assigned agent and send one Slack message with Send a Message to the support channel. The message leads with the total count of stale tickets across the whole sweep. Then the unassigned tickets come first under their own clear heading, since tickets with no owner are usually the worst offenders, followed by one section per agent under that agent's name. Under each heading, list that group's tickets with the ticket number, the subject, the age in days since the last update, and a link to the ticket using the ticket's web URL from the Zoho Desk record. Slack uses mrkdwn rather than standard Markdown, so links are formatted as <url|text> and bold is single asterisks. Keep it one message, not one per agent. If no tickets are stale, send a short all clear message instead so the team knows the sweep ran.

Then append the same findings to a Google Sheets tracker using Append Values, one row per stale ticket, capturing the run date, the ticket number, the subject, the assignee name or Unassigned, the days since last update, and the ticket status. Append rather than overwrite so the sheet accumulates a running history the team can look back over to spot patterns in what goes stale. On an all clear day, skip the append entirely rather than writing an empty row.

Two things I will want to tune, so make them obvious named constants near the top of the code rather than values buried in the logic: the three day staleness threshold, and the 8am weekday schedule.

What does this prompt do?

  • Checks your Zoho Desk helpdesk every weekday morning for open tickets that have had no activity in three or more days.
  • Posts a single Slack message that opens with the total number of stale tickets, then breaks them down by the agent who owns them, with each ticket's age in days and a direct link.
  • Puts unassigned stale tickets at the top of the message, because tickets with nobody's name on them are the ones most likely to be forgotten.
  • Adds a row to a Google Sheets tracker for every stale ticket, so you build up a history and can see which people and queues go quiet most often.

What do I need to use this?

  • A Zoho Desk account with permission to view tickets and the list of support agents.
  • A Slack workspace and the channel where you want the morning sweep posted.
  • A Google account and a spreadsheet to use as the tracker, ideally with a header row for run date, ticket number, subject, assignee, days since last update, and status.

How can I customize it?

  • Change what counts as stale. Three days is the default, but a fast-moving team might drop it to one day and a low-volume queue might stretch it to a week.
  • Change the timing. It runs at 8am on weekdays, and you can move the hour, switch to a weekly sweep, or include weekends.
  • Narrow the sweep to a single department, queue, or set of ticket statuses if you only want to watch one part of the helpdesk.
  • Point the Slack message at a different channel, or split high-volume teams into their own channels.

FAQs

What counts as a stale ticket?
Any open ticket that has gone three or more days without an update at the moment the sweep runs. Three days is just the default starting point, and you can raise or lower it to match how fast your team is expected to respond.
Does this close or reply to any tickets?
No. The sweep only reads from Zoho Desk. Nothing gets closed, reassigned, or answered automatically, so it is safe to switch on without worrying about it touching a live customer conversation.
What happens on a day when nothing is stale?
You get a short all clear message in Slack so you know the check actually ran, and no rows are added to the spreadsheet that day.
Why send to Slack and a spreadsheet?
Slack tells you what needs attention today. The spreadsheet accumulates a history, so after a few weeks you can see whether the same person, queue, or type of request keeps going quiet.
Will it work if some tickets have no owner?
Yes, and those are handled deliberately. Unassigned stale tickets get their own heading at the very top of the Slack message rather than being mixed in or dropped.

Related templates

Build a credential rotation checklist when someone leaves

When someone leaves, we check which shared passwords they used in their final months and post a ranked rotation list to your security channel.

1Password
Rippling
Slack Bot
+1
Agentic Task
Weekly Amazon S3 bucket security audit posted to Slack

Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.

Amazon S3
Slack Bot
Google Sheets
Agentic Task
Log Agorapulse social conversations to HubSpot contacts

Twice every weekday, the conversations from your social inbox land on the right HubSpot contact timelines, with a Slack recap for sales.

Agorapulse
HubSpot
Slack Bot
Agentic Task
Turn procurement portal tenders into CRM deals each morning

Every weekday at 7am, sign in to the tender portals you track, filter new notices against your bid criteria, and open a deal for the ones worth chasing.

Anchor Browser
Google Sheets
HubSpot
+1
Agentic Task
Clean up HubSpot contacts from your Amazon SES suppression list

Every morning, find the addresses that hard bounced or filed a spam complaint, update the matching HubSpot contacts, and post a short Slack recap.

Amazon SES
HubSpot
Slack Bot
Agentic Task
Draft polite follow-ups for emails that never got a reply

Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.

Aurinko
Google Sheets
Slack Bot
Agentic Task

Stop letting support tickets go quiet.

Set the weekday sweep up once and your team starts every morning knowing exactly which tickets have gone cold and who owns them.