# PagerDuty incident escalated or reassigned notifications on your phone > Get a High-priority push notification when a PagerDuty incident escalates, is reassigned or is delegated to another escalation policy, optionally only when it lands on you. - Company: PagerDuty (https://www.justpush.io/recipes/pagerduty) - Event: `incident.escalated` (incident.escalated, incident.reassigned and incident.delegated) - Tags: Monitoring & observability, Issues & tickets - Install: https://studio.justpush.io/recipes/pagerduty/incident-assigned - Web page: https://www.justpush.io/recipes/pagerduty/incident-assigned ## Setup 1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL. 2. In PagerDuty, go to Integrations > Generic Webhooks (v3) and click New Webhook (or add one on a service's Integrations tab). 3. Paste your webhook URL (shown in Studio after install) as the Webhook URL. 4. Under Event Subscription, tick incident.escalated, incident.reassigned and incident.delegated and click Add Webhook. 5. Create a v3 webhook under **Integrations → Generic Webhooks (v3) → New Webhook** (Managers and Admins), or on a single service under **Services → Service Directory → your service → Integrations → Webhooks**. Paste the URL above and tick **incident.escalated**, **incident.reassigned** and **incident.delegated**. The recipe ignores every other event type. 6. To only get a push when an incident lands on you, add your PagerDuty user ID (the `PXXXXXX` part of your profile URL) or your name as it appears in PagerDuty (write spaces as `%20`, e.g. `?user=Jane%20Doe`): 7. ``` 8. your webhook URL (shown in Studio after install)?user=PXXXXXX 9. ``` 10. The recipe reads the new assignees from the incident in the payload. PagerDuty's docs don't say whether that list is always updated by the time the escalation event is sent, so test `?user=` with a real escalation before relying on it. 11. To check the connection, open the webhook, click **Send Test Event** under **Test**, and you'll get a quiet "PagerDuty connected" push. 12. PagerDuty signs every v3 webhook with an `X-PagerDuty-Signature` header (HMAC-SHA256 with the subscription's secret), but JustPush doesn't check that signature yet, so keep your endpoint URL private. ## Code Studio calls `handleRequest(request)` with the incoming webhook (`{ method, headers, body, query, raw }`) and sends the message object it returns. Returning `null` sends nothing. ```js // PagerDuty → incident.escalated, incident.reassigned, incident.delegated // Fires when an open PagerDuty incident lands on someone else: it escalates, someone // reassigns it, or it's handed to another escalation policy. // Docs: https://docs.pagerduty.com/developer/webhooks-overview // Each event and how to label it. All of them are High (1): a new responder has to act // soon. PagerDuty itself pages the new assignee, so this isn't Highest. const EVENTS = { "incident.escalated": "⏫ Escalated:", "incident.reassigned": "↪️ Reassigned:", "incident.delegated": "↪️ Delegated:", } // Look a key up without tripping over inherited names like "toString". function pick(table, key, fallback) { return typeof key === "string" && Object.prototype.hasOwnProperty.call(table, key) ? table[key] : fallback } // Only link to real http(s) URLs. function link(url, cta) { return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : [] } // A trimmed string, or null for anything else. function text(value) { return typeof value === "string" && value.trim() ? value.trim() : null } function handleRequest(request) { const body = request.body && typeof request.body === "object" ? request.body : {} const event = body.event && typeof body.event === "object" ? body.event : {} const type = event.event_type // "Send Test Event" on the subscription sends a pagey.ping; confirm the connection quietly. if (type === "pagey.ping") { return { title: "🔔 PagerDuty connected", message: text(event.data?.message) ?? "Your webhook subscription is working", topic: "PagerDuty", priority: -1, } } // Guard: only escalations and hand-overs. v3 webhooks have no event header, so the // payload's event_type decides. const label = pick(EVENTS, type, null) const incident = event.data if (!label || !incident || typeof incident !== "object") { console.log(`Ignoring PagerDuty "${type ?? "unknown"}" event`) return null } const assignees = (Array.isArray(incident.assignees) ? incident.assignees : []).filter( (user) => user && typeof user === "object", ) // ?user=PXXXXXX (a user ID) or ?user=Jane Doe (a name) only pushes when that person // is one of the new assignees. const user = text(request.query?.user)?.toLowerCase() if (user && !assignees.some((a) => [a.id, a.summary].some((v) => text(v)?.toLowerCase() === user))) { console.log(`Skipping "${type}": not assigned to ${user}`) return null } const title = text(incident.title) ?? text(incident.summary) ?? "An incident" const names = assignees.map((a) => text(a.summary)).filter(Boolean).join(", ") // A delegation moves the incident to another escalation policy, so name the policy too. const policy = type === "incident.delegated" ? text(incident.escalation_policy?.summary) : null const to = names || policy const number = Number.isFinite(incident.number) ? `#${incident.number}` : null return { title: `${label} ${title}`, message: [to ? `Now with ${to}` : "Now with someone else", number, text(incident.service?.summary)] .filter(Boolean) .join(" · "), topic: "PagerDuty", priority: 1, // see EVENTS above buttons: link(incident.html_url, "Open incident"), } } ``` ## PagerDuty incident.escalated webhook payload (sample) ```json { "event": { "id": "01D8XQ3N1PC4X8D2Z5G9L0IJKL", "data": { "id": "PGR0VU2", "self": "https://api.pagerduty.com/incidents/PGR0VU2", "type": "incident", "teams": [ { "id": "PFCVPS0", "self": "https://api.pagerduty.com/teams/PFCVPS0", "type": "team_reference", "summary": "Payments", "html_url": "https://acme.pagerduty.com/teams/PFCVPS0" } ], "title": "Checkout API error rate above 5%", "number": 1234, "status": "triggered", "service": { "id": "PF9KMXH", "self": "https://api.pagerduty.com/services/PF9KMXH", "type": "service_reference", "summary": "Checkout API", "html_url": "https://acme.pagerduty.com/services/PF9KMXH" }, "urgency": "high", "html_url": "https://acme.pagerduty.com/incidents/PGR0VU2", "priority": { "id": "PSO75BM", "self": "https://api.pagerduty.com/priorities/PSO75BM", "type": "priority_reference", "summary": "P1", "html_url": "https://acme.pagerduty.com/account/incident_priorities" }, "assignees": [ { "id": "PK7RT2M", "self": "https://api.pagerduty.com/users/PK7RT2M", "type": "user_reference", "summary": "Jane Doe", "html_url": "https://acme.pagerduty.com/users/PK7RT2M" } ], "created_at": "2026-09-29T10:51:28Z", "incident_key": "d3640fbd41094207a1c11e58e46b1662", "resolve_reason": null, "conference_bridge": null, "escalation_policy": { "id": "PUS0KTE", "self": "https://api.pagerduty.com/escalation_policies/PUS0KTE", "type": "escalation_policy_reference", "summary": "Checkout on-call", "html_url": "https://acme.pagerduty.com/escalation_policies/PUS0KTE" } }, "agent": null, "client": null, "event_type": "incident.escalated", "occurred_at": "2026-09-29T11:21:28.311Z", "resource_type": "incident" } } ``` ## FAQ ### Does this work on iPhone and Android? Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification. ### Do I need to write code? No. Install the recipe in Studio, paste your webhook URL into PagerDuty and you are done. The code is there if you want to change the text, the sound or the buttons. ### Can I change what the notification says? Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save. ### What does it cost? JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.