Skip to content

Weekly

Get a weekly incident report by service

Every Monday you see how many incidents each service had last week and how long they took to resolve on average.

Runs
Weekly
Apps
PagerDuty
AI
Not needed
Access
read

Send this to your assistant

Create a ClickRuntime automation: every Monday at 9am, email me last week's PagerDuty incidents grouped by service, with the count and mean time to resolve for each.

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

Ask an engineering director how reliable last week was and the honest answer is usually a shrug. The data exists in PagerDuty, but pulling it means exporting incidents, grouping them by service in a spreadsheet and working out how long each took to resolve. Most weeks nobody does it, so a service that pages the team every night goes unnoticed until people are burnt out.

Once a week, incidents from the past seven days are listed from PagerDuty and grouped by service. For each service the count is shown along with the mean time to resolve, calculated from created and resolved times, and the result arrives in one email. The numbers come from the same incident records your responders already work in.

It works well as a Monday review for a platform team, and for managers who need a simple trend line to show leadership without building a dashboard.

What you get out of it

  • See which service pages the most

    A count per service names the noisiest system in plain numbers. Teams can then argue about fixing that service instead of about whose gut feeling about reliability is right. That clarity makes prioritizing much easier.

  • Mean time to resolve as a trend

    Seeing MTTR every week shows whether response is getting faster or slower. A creeping increase is an early sign of understaffing, weak runbooks or a service that has become harder to debug.

  • A record for reviews and audits

    Weekly summaries accumulate into a searchable history in your inbox. When a quarterly review or a customer asks about reliability, the figures are already there and need no reconstruction from memory.

  • Justify fixing the boring problems

    A service with forty incidents in a week makes a convincing case for engineering time. The report turns a vague complaint about alert fatigue into evidence a planning meeting can act on.

  • Protect on-call people from burnout

    When one team absorbs most of the pages, it shows in the counts. Managers can rebalance ownership or add a rotation before people start leaving because of nights spent on the same recurring alert.

How it works

What happens, step by step

  1. Every Monday ClickRuntime gets last week's PagerDuty incidents.

  2. It groups them by service.

  3. It works out the average time each service took to resolve its incidents.

  4. The report arrives in your inbox, one line per service.

Before it runs live

  • Connect PagerDuty

What you get

RunsWeekly
Get a weekly incident report by servicetoday, 9:00Succeeded
Email · Weekly incidentscheckout-api: 4 incidents, MTTR 38 min search: 1 incident, MTTR 12 min

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 PagerDuty 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.
get_a_weekly_incident_report.pyexample
from collections import defaultdict
from datetime import datetime, timedelta, timezone
from clickruntime import on_trigger, credentials, http, notify

PD = "https://api.pagerduty.com"

def pd(path, **params):
    resp = http.get(f"{PD}{path}", params=params, headers={"Authorization": f"Token token={credentials.secret('PAGERDUTY_API_KEY')}",
                    "Accept": "application/json"})
    resp.raise_for_status()
    return resp.json()

def ts(s):
    return datetime.fromisoformat(s.replace("Z", "+00:00"))

@on_trigger
def run(event):
    until = datetime.now(timezone.utc)
    incidents = pd("/incidents", since=(until - timedelta(days=7)).isoformat(), until=until.isoformat(), limit=100)["incidents"]
    by_service = defaultdict(list)
    for i in incidents:
        by_service[i["service"]["summary"]].append(i)
    lines = []
    for service, items in sorted(by_service.items(), key=lambda kv: -len(kv[1])):
        resolved = [(ts(i["resolved_at"]) - ts(i["created_at"])).total_seconds() / 60 for i in items if i.get("resolved_at")]
        mttr = f"{sum(resolved) / len(resolved):.0f} min" if resolved else "n/a"
        lines.append(f"{service}: {len(items)} incidents, MTTR {mttr}")
    notify.email_me(f"PagerDuty last week: {len(incidents)} incidents", "\n".join(lines))
    return {"incidents": len(incidents)}

FAQ

Common questions

Does it count low-urgency incidents too?
By default it includes every incident PagerDuty returns for the period, whatever the urgency. If you only care about high-urgency pages, you can tell your AI assistant to filter on urgency and show the new version for approval first.
How is time to resolve calculated for incidents still open?
Resolution time needs a resolved timestamp, so incidents that are still open at the time of the report have no finished duration. They can be counted in the totals while being left out of the average, so open ones do not distort MTTR.
Will it work if we have dozens of services?
Yes. Grouping happens per service no matter how many exist, and the email lists each with its own count and average. A long list reads best sorted by count, which is the order most teams choose.
What permissions does it need?
read. 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 (weekly). 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 “Get a weekly incident report by service” from your assistant

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