Skip to content

On a schedule

Spot recurring incidents in ServiceNow every morning

Each morning your IT channel gets a short list of problems that keep coming back across the last week of incidents, with counts and links.

Runs
On a schedule
Apps
ServiceNow, Slack
AI
Yes, uses the built-in AI allowance
Access
ServiceNow read; Slack chat:write

Send this to your assistant

Create a ClickRuntime automation: every morning, look at the last 7 days of ServiceNow incidents, have AI group similar ones into recurring issues, and post them to #it-ops with counts and example incident numbers.

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 university IT department closes hundreds of incidents a week. Each one is handled on its own: a printer reset here, a password unlock there. Nobody has time to step back and notice that forty of last week's tickets were the same Wi-Fi problem in one building, which a single root cause fix would have prevented.

This automation steps back for them. Every morning it pulls the last seven days of incidents, AI groups the ones that describe the same underlying issue, and a short summary is posted in #it-ops with the count and example incident numbers for each recurring problem. The team can decide what deserves a problem record.

What you get out of it

  • Fix causes, not symptoms

    Seeing that the same issue happened forty times makes the case for a permanent fix. Solving the root cause removes a whole stream of tickets.

  • Patterns humans miss

    Similar incidents are often logged with different wording by different people. Grouping by meaning catches them even when the descriptions do not match.

  • Evidence for problem management

    Each group comes with counts and incident numbers. That is exactly what you need to open a problem record or justify a change.

  • A short read each morning

    The summary is a handful of lines in Slack. It fits into the morning stand-up without anyone running a report.

How it works

What happens, step by step

  1. Every morning, ClickRuntime pulls the incidents created in ServiceNow over the last seven days.

  2. It keeps just the number, category and short description of each.

  3. AI groups incidents that describe the same underlying issue and counts each group.

  4. The recurring issues are posted to #it-ops with their counts and example incident numbers.

Before it runs live

  • Connect ServiceNow
  • Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)

What you get

RunsOn a schedule
Spot recurring incidents in ServiceNow every morningtoday, 9:00Succeeded
Slack · #it-ops🔁 Recurring issues: Wi-Fi drops in Library building - 38 - INC0021001, INC0021044, INC0021102

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
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Google Sheets
  • Combine it with other ServiceNow and Slack 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.
detect_recurring_incidents_with_ai.pyexample
from clickruntime import on_trigger, credentials, http, ai, notify

INSTANCE = "northwind.service-now.com"

def sn(method, path, **kw):
    r = http.request(method, f"https://{INSTANCE}/api/now/table/{path}", auth=(credentials.secret("SERVICENOW_USER"), credentials.secret("SERVICENOW_PASSWORD")),
                     headers={"Accept": "application/json"}, **kw)
    r.raise_for_status()
    return r.json()["result"]

@on_trigger
def run(event):
    incidents = sn("GET", "incident", params={"sysparm_query": "sys_created_on>=javascript:gs.daysAgoStart(7)", "sysparm_limit": "400",
                                              "sysparm_fields": "number,category,short_description"})
    if not incidents:
        return {"incidents": 0}
    lines = "\n".join(f"{i['number']} [{i['category']}] {i['short_description'][:120]}" for i in incidents)
    summary = ai.generate(f"Incidents from the last 7 days:\n{lines}\n\nGroup incidents describing the same underlying issue. "
                          "List groups with 3 or more incidents as: issue - count - up to 3 example numbers. Most frequent first.",
                          max_output_tokens=600).text.strip()
    notify.slack(f"🔁 Recurring issues, last 7 days ({len(incidents)} incidents):\n{summary}", channel="#it-ops")
    return {"incidents": len(incidents)}

FAQ

Common questions

How many incidents does it look at?
Up to a few hundred from the last seven days, using only the short description and category of each to keep it quick.
Can I look back further?
Yes. Set the window to 14 or 30 days. A longer window shows slower patterns, such as monthly batch job failures.
Does it create problem records?
No. It points out the patterns and leaves the decision to your team. You can open a problem record from the incident links.
What permissions does it need?
ServiceNow read; Slack chat:write. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly 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 “Spot recurring incidents in ServiceNow every morning” from your assistant

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