Skip to content

The moment it happens

Look up an incident from a Slack command

Typing an incident number into a slash command replies with its state, priority and assignee.

Runs
The moment it happens
Apps
ServiceNow
AI
Not needed
Access
read incident

Send this to your assistant

Create a ClickRuntime automation: give me a link for a Slack slash command. When someone types /incident INC0012345, reply with that ServiceNow incident's state, priority and assigned person.

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

During an outage, someone in chat says 'what's the status of INC0012345?' and the conversation stops while a person finds the right browser tab, logs into ServiceNow, searches for the number and pastes the answer back. Multiply that by every question about a ticket, from managers, support staff and other teams that do not have ServiceNow access, and the service desk becomes a lookup service. Context gets lost between the question and the answer, and people who do not use ServiceNow never get one.

When someone types the slash command with an incident number, the automation parses the number, queries the ServiceNow incident table, and replies to the response URL in the same conversation with its details: short description, state, priority, assignee and last update. It answers within seconds of the command. IT teams use it so anyone in the channel can get an incident status without leaving chat.

What you get out of it

  • Answers appear where the question was asked

    The status is posted straight into the conversation. Nobody has to switch tools, and the outage discussion continues without waiting for a person to look something up. During an outage call, typing the command beats opening a browser tab, logging in and searching.

  • Non-ServiceNow users stay informed

    Sales, support and executives can check an incident without a license. That cuts the number of requests landing on the service desk and gives them accurate information rather than rumors.

  • The service desk is interrupted less

    Technicians who used to field every 'what is happening with this?' message can stay focused on resolving incidents. The most common question is answered without them. The technician who used to answer 'any update on INC0012345?' ten times a day gets that time back.

  • Everyone sees the same facts

    The reply shows current state, priority and assignee, so a channel of twenty people works from one answer. Contradictory status updates relayed by different people become less common. Twenty people in a channel read one answer instead of three conflicting relays of last night's update.

  • Faster handoffs during incidents

    On-call staff can pull up an incident's last update in seconds when joining a call. Less time spent finding information means quicker decisions in the first minutes of an incident.

How it works

What happens, step by step

  1. When someone types the slash command in Slack with an incident number, Slack sends it to ClickRuntime.

  2. ClickRuntime looks the incident up in ServiceNow.

  3. It replies in Slack with the incident's title, state, priority and who it is assigned to.

Before it runs live

  • Connect ServiceNow
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Look up an incident from a Slack commandjust nowSucceeded
Slack · /incident INC0012345INC0012345 Email delivery delayed State: In Progress · Priority: 2 - High · Assigned to: Robin Hale

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
  • 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 ServiceNow 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.
look_up_incident_details_from_a_chat_command.pyexample
from urllib.parse import parse_qs
from clickruntime import on_event, credentials, http

INSTANCE = "northwind"

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

@on_event
def handle(event):
    form = {k: v[0] for k, v in parse_qs(event.body).items()}
    number = form.get("text", "").strip().upper()
    rows = snow("GET", "table/incident", params={"sysparm_query": f"number={number}", "sysparm_display_value": "true",
                                                 "sysparm_fields": "number,state,priority,assigned_to,short_description",
                                                 "sysparm_limit": 1})
    if rows:
        i = rows[0]
        text = (f"*{i['number']}* {i['short_description']}\nState: {i['state']} · Priority: {i['priority']} · "
                f"Assigned to: {(i['assigned_to'] or {}).get('display_value', 'nobody')}")
    else:
        text = f"No incident found for {number or '(empty)'}."
    http.post(form["response_url"], json={"response_type": "ephemeral", "text": text})
    return {"found": bool(rows)}

FAQ

Common questions

What format does the incident number need to be in?
The standard ServiceNow format, for example INC0012345. If what was typed does not match an incident, the reply says it was not found rather than staying silent. Lowercase numbers or extra words around it are tolerated, since the number is pulled out of whatever text follows the command.
Will it show private details to everyone in the channel?
Only the fields you choose are included in the reply. Keep fields like the caller's personal information or work notes out of it if the channel is broad, or send the reply privately to the person who asked.
Can it look up other records such as changes or requests?
Yes. Changes, requests and problems have their own prefixes such as CHG, REQ and PRB, so the same command can look up any of them if you ask. Each type needs its own table query and display fields, such as a change window or requested item, which are set up once.
What permissions does it need?
read incident. 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 for each event the app sends.
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 “Look up an incident from a Slack command” from your assistant

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