Integrations

ServiceNow PagerDuty Integration Guide

intermediateAPI Key in Authorization header (Bearer token)PagerDuty

The ServiceNow PagerDuty integration provides bidirectional synchronization between ServiceNow incidents and PagerDuty alerts, enabling seamless incident management workflows for IT operations and DevOps teams. This integration solves the problem of context switching between platforms by automatically creating PagerDuty incidents from ServiceNow incidents and vice versa, while maintaining escalation policies and on-call schedules. ServiceNow administrators and incident managers use this integration to ensure critical incidents are properly escalated to the right personnel with appropriate urgency levels. The integration supports bidirectional data flow using the official PagerDuty spoke in Integration Hub, with real-time webhook notifications triggering automated incident creation, updates, and resolution synchronization. The primary automation pattern involves outbound REST messages for ServiceNow-to-PagerDuty communication and inbound webhook processing for PagerDuty-to-ServiceNow updates, all managed through the Integration Hub module.

Prerequisites

  • ServiceNow Rome release or later with Integration Hub Professional license
  • PagerDuty account with API access and Admin-level permissions
  • PagerDuty REST API v2 access token with read/write permissions
  • ServiceNow admin role with access to Integration Hub and Connection & Credential management
  • Network connectivity allowing outbound HTTPS connections to PagerDuty API endpoints
  • Understanding of ServiceNow Business Rules and Workflow concepts
  • Knowledge of PagerDuty services, escalation policies, and incident lifecycle

Architecture Overview

The ServiceNow PagerDuty integration utilizes the official PagerDuty spoke available in the Integration Hub, which provides pre-built actions for incident creation, updates, and resolution synchronization. Authentication is established using PagerDuty's REST API v2 token stored as a Connection Alias in ServiceNow's Connections & Credentials framework, with the credential automatically attached to outbound REST messages. Data flows bidirectionally with ServiceNow incidents triggering PagerDuty incident creation via spoke actions, while PagerDuty webhooks push status updates back to ServiceNow through Scripted REST APIs or the webhook processor. No MID Server is required as all communication occurs over HTTPS to PagerDuty's public API endpoints, but organizations with strict firewall policies may need to whitelist PagerDuty's webhook IP ranges. Rate limiting considerations include PagerDuty's default limit of 120 requests per minute per API token, which should be managed through proper flow control in ServiceNow business rules and scheduled jobs.

Sourdough
Chrome Extension

Sourdough: ServiceNow Monitoring and Analytics

A Chrome extension for ServiceNow Admins and Developers with essential tools, analytics, graphs and monitoring features.

Instance HealthGraphs & ChartsAPI HealthDeveloper ToolsQuick SearchInstance Switcher
Add to Chrome

Free to install. Pro $5/month after a 14-day no-card trial.
Pro requires the ServiceNow admin role. Upgrade inside the extension.

Overview
Tasks
CMDB
API
Metrics
Monitor
Internals
Instance:sourdoughdev·Version:Yokohama
Instance StateONLINE
System StatusFully Operational
Session Timeout90 minutes
Logged-In Sessions2 (20 active)
Build Nameyokohama-12-18-2024_p1
IP Address10.159.128.43
Instance HealthHealth Score: 90%
🔥 5dSourdough (Chrome Plugin)Dark Mode

Implementation Steps

1

Create PagerDuty API token and configure ServiceNow credential

Log into your PagerDuty account and navigate to Configuration > API Access to generate a new API v2 token with full access permissions. Copy the generated token and switch to ServiceNow, then navigate to Connections & Credentials > Credentials and click New to create a new API Key credential. Set the credential name to 'PagerDuty API Token', select API Key as the type, and paste the PagerDuty token into the API Key field. Save the credential and note the sys_id for use in connection aliases, ensuring the token has proper read/write permissions for incidents and services.

2

Install and configure the PagerDuty spoke from Integration Hub

Navigate to Integration Hub > Browse Applications and search for the official PagerDuty spoke in the ServiceNow Store. Install the PagerDuty spoke which includes pre-built actions for incident management, escalation policies, and service operations. After installation, go to Integration Hub > Connections and create a new Connection Alias named 'PagerDuty Connection' with the base URL 'https://api.pagerduty.com'. Attach the previously created API Key credential to this connection alias and test the connection to verify successful authentication with PagerDuty's API.

3

Configure PagerDuty service mapping and escalation policies

Navigate to Integration Hub > Action Designer and examine the available PagerDuty spoke actions including 'Create Incident', 'Update Incident', and 'Get Services'. Create a new custom table 'u_pagerduty_service_mapping' to map ServiceNow assignment groups or services to PagerDuty service IDs and escalation policies. Use the 'Get Services' spoke action to retrieve your PagerDuty services and populate this mapping table with appropriate ServiceNow categories, assignment groups, and corresponding PagerDuty service IDs. Test the service retrieval action to ensure proper API connectivity and data format before proceeding to incident synchronization setup.

ServiceNow Script
var gr = new GlideRecord('u_pagerduty_service_mapping');
gr.initialize();
gr.servicenow_assignment_group = 'Database Team';
gr.pagerduty_service_id = 'P1234567';
gr.escalation_policy_id = 'EP123456';
gr.insert();
4

Create outbound integration flow for ServiceNow to PagerDuty incidents

Navigate to Integration Hub > Flow Designer and create a new flow triggered by 'Record Updated' on the Incident table. Add conditions to trigger only when incident priority is 1 or 2 and state changes to 'In Progress' or when a new P1/P2 incident is created. Configure the PagerDuty 'Create Incident' spoke action with dynamic field mapping including incident title from ServiceNow short description, urgency mapping based on ServiceNow priority, and service assignment from your mapping table. Include error handling to log failed PagerDuty incident creations and optionally create ServiceNow events for monitoring integration health.

ServiceNow Script
// In Flow Designer Data Transform
data.title = source.short_description.toString();
data.service = {
  id: source.u_pagerduty_service_id.toString(),
  type: 'service_reference'
};
data.urgency = source.priority <= 2 ? 'high' : 'low';
data.incident_key = source.number.toString();
5

Implement PagerDuty webhook endpoint for inbound synchronization

Navigate to System Web Services > Scripted REST APIs and create a new API called 'PagerDuty Webhook Processor' with resource path '/api/now/pagerduty/webhook'. Configure the HTTP method as POST and implement the resource script to process PagerDuty webhook payloads for incident state changes. Parse the incoming webhook JSON to extract PagerDuty incident ID, status, and incident key, then query ServiceNow incidents using the incident key stored in a custom field. Update ServiceNow incident states based on PagerDuty status changes (triggered=In Progress, resolved=Resolved) and add work notes documenting the PagerDuty activity.

ServiceNow Script
(function process(request, response) {
  var payload = JSON.parse(request.body.dataString);
  var messages = payload.messages || [];
  
  for (var i = 0; i < messages.length; i++) {
    var incident = messages[i].incident;
    var gr = new GlideRecord('incident');
    gr.addQuery('u_pagerduty_incident_key', incident.incident_key);
    if (gr.next()) {
      if (incident.status == 'resolved') {
        gr.state = 6; // Resolved
        gr.work_notes = 'Incident resolved in PagerDuty by ' + incident.last_status_change_by.summary;
      }
      gr.update();
    }
  }
  
  return new sn_ws_int.RESTAPIResponse();
})(request, response);
6

Configure PagerDuty webhook subscriptions and endpoint security

In PagerDuty, navigate to Configuration > Extensions and create a new Generic V2 Webhook extension pointing to your ServiceNow webhook endpoint URL. Configure the webhook to trigger on incident.triggered, incident.acknowledged, and incident.resolved events with the full incident object in the payload. Set up webhook signature verification by adding the PagerDuty webhook secret to your ServiceNow credential store and modifying your Scripted REST API to validate incoming webhook signatures. Test webhook delivery using PagerDuty's webhook testing tool and verify ServiceNow receives and processes the payloads correctly by monitoring the REST API execution logs.

ServiceNow Script
// Webhook signature validation in Scripted REST API
var signature = request.getHeader('X-PagerDuty-Signature');
var requestBody = request.body.dataString;
var secret = gs.getProperty('pagerduty.webhook.secret');
var expectedSignature = GlideDigest.getMD5Hash(requestBody + secret);

if (signature !== expectedSignature) {
  response.setStatus(401);
  return;
}
7

Implement on-call schedule visibility and escalation policy sync

Create a scheduled job to periodically sync PagerDuty on-call schedules into ServiceNow for visibility purposes by navigating to System Definition > Scheduled Jobs. Configure the job to run every 15 minutes, calling PagerDuty's schedules API to retrieve current on-call personnel and their contact information. Store this data in a custom table 'u_pagerduty_oncall' linked to ServiceNow user records for dashboard reporting and incident assignment suggestions. Include escalation policy details to help ServiceNow users understand the PagerDuty escalation path before creating incidents, and add this information to incident forms as reference fields.

ServiceNow Script
var rm = new sn_ws.RESTMessageV2('PagerDuty', 'GET');
rm.setEndpoint('https://api.pagerduty.com/oncalls');
rm.setRequestHeader('Authorization', 'Token token=' + gs.getProperty('pagerduty.api.token'));
rm.setRequestHeader('Accept', 'application/vnd.pagerduty+json;version=2');

var response = rm.execute();
if (response.getStatusCode() == 200) {
  var oncalls = JSON.parse(response.getBody()).oncalls;
  // Process and store on-call data
}
8

Test end-to-end integration and configure monitoring

Create a test P1 incident in ServiceNow and verify it automatically creates a corresponding incident in PagerDuty with proper service assignment and escalation policy. Trigger status changes in PagerDuty (acknowledge, resolve) and confirm these updates synchronize back to ServiceNow with appropriate state changes and work notes. Set up integration monitoring by creating ServiceNow events for failed API calls, webhook processing errors, and sync failures, then configure event management rules to alert administrators. Document the integration configuration and create operational procedures for troubleshooting common issues like authentication failures, webhook delivery problems, and service mapping errors.

ServiceNow Script
// Integration health check script
var gr = new GlideRecord('incident');
gr.addQuery('priority', '1');
gr.addQuery('u_pagerduty_incident_id', 'ISEMPTY');
gr.addQuery('sys_created_on', '>', gs.hoursAgo(1));
gr.query();

if (gr.getRowCount() > 0) {
  gs.eventQueue('pagerduty.sync.failure', gr, 'Incidents not synced to PagerDuty', 'Integration health check');
}

Common Use Cases

Automatic P1/P2 incident escalation to PagerDuty

ServiceNow automatically creates PagerDuty incidents when critical (Priority 1) or high (Priority 2) incidents are logged, ensuring immediate notification to on-call engineers. The integration maps ServiceNow assignment groups to appropriate PagerDuty services and escalation policies, maintaining proper incident routing. Status updates flow bidirectionally, so when PagerDuty incidents are acknowledged or resolved, the corresponding ServiceNow incident reflects these changes with automatic work notes. This use case reduces mean time to response (MTTR) by eliminating manual incident escalation steps and ensures no critical incidents are missed.

Service-specific incident routing and escalation policy mapping

Different ServiceNow services (database, network, application) automatically route to corresponding PagerDuty services with service-specific escalation policies and on-call schedules. The integration uses a mapping table to determine which PagerDuty service and escalation policy should handle incidents based on ServiceNow categories, configuration items, or assignment groups. ServiceNow users can view the associated PagerDuty escalation policy and current on-call personnel before submitting incidents, improving incident quality and routing accuracy. This ensures domain expertise is applied to incidents and reduces unnecessary escalations to incorrect teams.

On-call schedule visibility within ServiceNow incident forms

ServiceNow displays current on-call personnel from PagerDuty schedules directly within incident forms and dashboards, helping incident managers understand who will respond to escalated incidents. The integration periodically syncs PagerDuty on-call schedules and displays this information as related lists or reference fields on incident records. ServiceNow users can see upcoming schedule changes and escalation paths without leaving the ServiceNow interface. This visibility improves incident assignment decisions and helps coordinate between ServiceNow incident management and PagerDuty response teams.

Automated incident lifecycle synchronization

Complete incident lifecycle events synchronize between platforms, including incident creation, acknowledgment, status updates, resolution, and post-incident notes. PagerDuty webhooks automatically update ServiceNow incident states when engineers acknowledge or resolve incidents, maintaining accurate records in both systems. ServiceNow work notes are automatically added when PagerDuty incidents are updated, providing complete audit trails for incident post-mortems and reporting. This bidirectional sync ensures both platforms serve as accurate sources of truth for incident history and metrics.

Integration health monitoring and error handling

The integration includes comprehensive monitoring for API failures, webhook delivery issues, authentication problems, and sync delays using ServiceNow's event management framework. Failed integration attempts generate ServiceNow events that can trigger notifications to ServiceNow administrators or create follow-up tasks for manual intervention. Rate limiting and API quota management prevents integration failures during high incident volumes, with graceful degradation and retry logic built into the flow design. Regular health checks verify connectivity, credential validity, and data consistency between platforms, ensuring reliable operation of the critical incident escalation workflow.

Troubleshooting

PagerDuty API returns 401 Unauthorized errors on outbound REST calls

First, verify the PagerDuty API token is valid by testing it directly in PagerDuty's API console or using a REST client. Navigate to Connections & Credentials > Credentials and confirm the API key credential contains the correct token without extra spaces or characters. Check the Connection Alias configuration to ensure it's using HTTPS and the correct base URL 'https://api.pagerduty.com' with the proper credential attached. If the token appears correct, regenerate a new API token in PagerDuty with full permissions and update the ServiceNow credential, as tokens may expire or be revoked.

ServiceNow incidents create successfully but PagerDuty incidents are not triggered

Examine the Integration Hub execution details by navigating to Integration Hub > Executions and filtering for your PagerDuty flow to identify any action failures or timeout errors. Verify the service mapping table contains valid PagerDuty service IDs by testing the 'Get Services' spoke action and comparing returned service IDs to your mapping configuration. Check that the PagerDuty service has an active escalation policy assigned, as incidents cannot be created for services without escalation policies. Review the flow conditions to ensure they match your incident criteria and check the flow execution logs for data transformation errors.

PagerDuty webhooks are not updating ServiceNow incident records

Verify webhook delivery by checking the PagerDuty webhook logs to confirm payloads are being sent successfully to your ServiceNow endpoint. Navigate to System Logs > REST API and filter for your webhook Scripted REST API to identify any processing errors or authentication failures. Ensure the webhook endpoint URL is accessible from external networks and not blocked by ServiceNow IP restrictions or security rules. Check that the incident key mapping is correctly stored in ServiceNow records and that webhook payload parsing matches the expected PagerDuty message format.

Duplicate incidents being created in PagerDuty for single ServiceNow incidents

Review your business rule or flow conditions to ensure they don't trigger multiple times for the same incident update by adding proper conditional logic to check if a PagerDuty incident already exists. Implement incident key tracking by storing the PagerDuty incident ID in a custom field on the ServiceNow incident record and checking this field before creating new PagerDuty incidents. Add proper error handling to prevent retry logic from creating duplicates when API calls timeout or return temporary errors. Consider using ServiceNow's flow execution context to prevent concurrent executions of the same integration flow.

On-call schedule sync fails with rate limiting errors

Reduce the frequency of your scheduled job that syncs on-call data from every 15 minutes to every hour or implement intelligent caching to only request updated schedule information. Implement exponential backoff in your REST message calls by adding error handling that waits and retries when receiving 429 rate limit responses from PagerDuty. Consider paginating large schedule requests and spreading API calls across time using scheduled script execution delays. Monitor your overall PagerDuty API usage across all ServiceNow integrations and flows to ensure you're staying within the 120 requests per minute limit.

ServiceNow incident status updates don't reflect PagerDuty incident resolution

Check the webhook signature validation in your Scripted REST API to ensure PagerDuty webhooks aren't being rejected due to security checks or signature mismatches. Verify that your webhook processing logic correctly maps PagerDuty status values (resolved, triggered, acknowledged) to appropriate ServiceNow incident states. Review the incident query logic in your webhook processor to ensure it's finding the correct ServiceNow incident using the incident key or PagerDuty incident ID. Test webhook processing manually by sending sample payloads to your endpoint and monitoring the REST API execution logs for any GlideRecord update errors.

Pro Tips

  • Implement custom incident correlation rules to prevent creating PagerDuty incidents for ServiceNow incidents that are duplicates or related to existing PagerDuty incidents. Use ServiceNow's Event Management module to correlate similar incidents before triggering PagerDuty escalation, reducing alert fatigue and improving incident response efficiency.
  • Create a ServiceNow dashboard that displays real-time PagerDuty incident metrics alongside ServiceNow incident data, providing unified visibility for incident managers. Use the PagerDuty Analytics API to pull incident response times, escalation frequency, and resolution metrics into ServiceNow reports for comprehensive incident management analysis.
  • Configure conditional escalation logic that considers ServiceNow incident assignment group availability before creating PagerDuty incidents, checking for active assignments or business hours. This prevents unnecessary PagerDuty notifications when ServiceNow teams are actively working on incidents and adds PagerDuty escalation as a fallback mechanism.
  • Implement intelligent priority mapping that considers both ServiceNow priority and impact fields when determining PagerDuty incident urgency, rather than relying solely on priority. Use ServiceNow's business rule conditions to adjust PagerDuty escalation based on affected configuration items, user VIP status, or business service impact levels.
  • Set up automated post-incident analysis by collecting PagerDuty incident metrics (response time, escalation levels reached, personnel involved) and correlating them with ServiceNow incident resolution data. Create scheduled reports that identify trends in escalation patterns and help optimize both ServiceNow assignment rules and PagerDuty escalation policies.
  • Use ServiceNow's Flow Designer error handling capabilities to implement sophisticated retry logic for PagerDuty API calls, including exponential backoff, alternate service routing, and graceful degradation. Configure integration circuit breakers that temporarily disable PagerDuty escalation when API errors exceed thresholds, preventing cascade failures.

Known Limitations

  • PagerDuty's REST API v2 has a rate limit of 120 requests per minute per API token, which can be exceeded during high incident volumes or when multiple ServiceNow instances share the same PagerDuty account. Organizations with large incident volumes may need to implement request queuing, throttling, or multiple API tokens to avoid rate limiting errors.
  • The Integration Hub Professional license is required to use the PagerDuty spoke and create custom integration flows, which may not be available in all ServiceNow licensing tiers. Organizations with Basic Integration Hub licenses must build custom REST integrations using Scripted REST APIs and outbound REST messages rather than the pre-built spoke actions.
  • PagerDuty webhook delivery is not guaranteed and uses eventual consistency, meaning ServiceNow incident updates may be delayed or missed if webhook endpoints are temporarily unavailable. Organizations requiring immediate synchronization should implement polling mechanisms or hybrid approaches that combine webhooks with periodic API polling for critical incident updates.

Frequently Asked Questions

Can I prevent certain ServiceNow incidents from creating PagerDuty incidents based on business hours or assignment group availability?

Yes, you can add conditional logic to your Integration Hub flow or business rule that checks ServiceNow's schedule management APIs to determine if incidents should escalate to PagerDuty based on business hours, holiday schedules, or assignment group availability. Use the GlideSchedule API to check if current time falls within business hours for the affected service or assignment group before triggering PagerDuty incident creation. You can also query the assignment group for active users or check for existing incident assignments to implement intelligent escalation logic that considers current ServiceNow team availability.

How do I handle PagerDuty incident updates that don't map directly to ServiceNow incident states?

Create a custom mapping table that translates PagerDuty incident statuses to ServiceNow incident states and include business logic for handling edge cases like PagerDuty's 'acknowledged' status. You can add custom fields to ServiceNow incidents to track PagerDuty-specific states that don't have direct ServiceNow equivalents, such as escalation level or acknowledging user. Consider using ServiceNow work notes to capture PagerDuty state changes that don't warrant ServiceNow state transitions, providing complete audit trails while maintaining ServiceNow's incident lifecycle integrity.

What happens if the same incident is manually created in both ServiceNow and PagerDuty?

Implement incident correlation logic using common identifiers like incident description keywords, affected services, or timestamp proximity to detect potential duplicates before creating cross-platform incidents. Use ServiceNow's duplicate detection capabilities combined with custom business rules to identify existing PagerDuty incidents that might correspond to new ServiceNow incidents. Configure your integration to check for existing incidents in both platforms using fuzzy matching algorithms or maintain a correlation table that tracks manual incident relationships, then update the integration mapping rather than creating duplicates.

Can I customize which PagerDuty incident details are synchronized back to ServiceNow?

Yes, you can customize webhook payload processing in your ServiceNow Scripted REST API to extract and map specific PagerDuty incident fields to ServiceNow incident fields or custom fields. Modify the webhook processing script to capture PagerDuty incident details like assigned users, escalation policy information, incident timeline, or custom PagerDuty incident fields into corresponding ServiceNow fields. Use ServiceNow's JSON parsing capabilities to selectively extract relevant data from PagerDuty webhook payloads and implement field mapping logic that handles data type conversions and validation before updating ServiceNow records.

How do I monitor and alert on PagerDuty integration failures or sync delays?

Configure ServiceNow Event Management to generate events for integration failures by adding error handling to your Integration Hub flows and webhook processors that create events when API calls fail or sync operations exceed expected timeframes. Set up scheduled jobs that perform integration health checks by comparing recent incident counts between platforms and generating alerts when discrepancies are detected. Use ServiceNow's monitoring and alerting framework to notify administrators of credential expiration, API rate limiting, webhook delivery failures, or service mapping configuration errors that could impact the integration's reliability.

Can I integrate PagerDuty with ServiceNow Change Management to prevent incidents during maintenance windows?

Yes, you can enhance the integration by adding Change Management awareness to your incident escalation logic, checking for active maintenance windows or scheduled changes before creating PagerDuty incidents. Query ServiceNow's Change Request table in your integration flow to identify if affected Configuration Items have scheduled maintenance, and either suppress PagerDuty escalation or route incidents to maintenance-aware escalation policies. Consider integrating PagerDuty's Maintenance Windows API to automatically create PagerDuty maintenance windows when ServiceNow emergency changes are approved, providing coordinated incident suppression across both platforms during planned maintenance activities.

What's the best practice for handling PagerDuty incident priority changes that occur outside of ServiceNow?

Configure PagerDuty webhooks to include incident priority updates and modify your ServiceNow webhook processor to update ServiceNow incident priority fields when PagerDuty incident urgency changes. Implement business logic that maps PagerDuty urgency levels (high, low) to appropriate ServiceNow priority values while considering your organization's priority definitions and escalation procedures. Add approval workflows for priority changes that originate from PagerDuty to ensure ServiceNow incident management processes are followed, and use work notes to document the reason and source of priority changes for audit and analysis purposes.

Test Your Knowledge

Quick 3-question quiz — see how your ServiceNow skills stack up.

Question 1 of 3Performance

A list view on a table with millions of records is slow. Best fix?

Select an answer to continue