ServiceNow Integration for Runbooks
Create records and synchronize incidents bidirectionally from runbooks.
Harness AI SRE offers comprehensive integration with ServiceNow, enabling both outbound (AI SRE to ServiceNow) and inbound (ServiceNow to AI SRE) incident management and tracking.
Overview
ServiceNow integration enables your runbooks to:
Create and update incidents
Track incident progress
Automate workflow transitions
Sync incident updates bidirectionally
Integration setup
Prerequisites
ServiceNow admin access
Instance URL
Service account credentials
Harness Project Admin role
Configure the ServiceNow connector
Set up the ServiceNow connector with the following steps:
Go to Project Settings, then Third Party Integrations (AI SRE).

Third-Party Integrations for AI SRE Select ServiceNow from the available integrations.
Configure authentication:
Instance URL
Username
Password/OAuth credentials
Test the connection.
Required permissions
The ServiceNow service account requires these roles:
incident_manager role
itil role
rest_service role
web_service_admin role
Use ServiceNow actions in runbooks
ServiceNow actions are configured through the runbook action form in the UI:
In your runbook, click New Step, then Action.

New Step Menu In the Select Action dialog, go to the Tickets & Code category.
Select the ServiceNow action you need from the available options.

Select Action Dialog Configure the action through a form-based interface with the following fields.
Create ServiceNow Incident action
The Create ServiceNow Incident action creates a new incident in ServiceNow and automatically updates the AI SRE incident's service_now_ticket field with the ServiceNow incident number.
Form fields:
Short Description: Brief title for the ServiceNow incident
Example:
{{Activity.title}}
Description: Detailed description of the incident
Example:
{{Activity.summary}}
Urgency: Urgency level (High, Medium, Low)
Impact: Impact level (High, Medium, Low)
Assigned To (optional): ServiceNow user sys_id or username to assign the incident to
Available Mustache variables:
{{Activity.title}}: AI SRE incident title{{Activity.summary}}: AI SRE incident summary{{Activity.severity}}: AI SRE incident severity{{Activity.status}}: AI SRE incident statusAny custom incident fields configured in your incident template
Field change triggers
You can configure runbooks to trigger when specific AI SRE incident fields change, enabling automatic updates to ServiceNow:
Supported trigger types:
State changes
Priority updates
Severity modifications
Assignment changes
When a field changes in AI SRE, the runbook can execute ServiceNow actions to keep both systems synchronized.
Advanced features
Sync architecture
Capabilities
A pipeline-based inbound sync can provide the following capabilities:
Incident sync
ServiceNow to Harness AI SRE status mapping
Automatic state transitions
Priority synchronization
Work notes sync
Bidirectional updates flow
Attachment synchronization
User mapping
Best practices
Incident management
Follow these practices for incident management:
Use standard categorization
Include business impact
Maintain SLA tracking
Workflow integration
Follow these practices for workflow integration:
Define clear state mappings
Document transition rules
Set up appropriate triggers
Monitor sync status
Field configuration
Follow these practices for field configuration:
Map essential fields
Use custom fields appropriately
Document field purposes
Validate field values
Common use cases
Major incident management
Use a runbook to drive major incident management through these steps:
Create ServiceNow incident
Assign response teams
Track resolution progress
Update stakeholders
SLA compliance
Use a runbook to track SLA compliance through these steps:
Monitor response times
Track resolution progress
Generate reports
Escalate as needed
Troubleshooting
Create incidents in AI SRE from ServiceNow
This section walks you through setting up an integration in Harness AI SRE to receive incident data from ServiceNow. By following these steps, you can automatically create incidents in Harness AI SRE based on ServiceNow incidents.
Integration setup process
1. Create the integration in AI SRE
Create the integration in AI SRE with the following steps:
Go to Integrations in AI SRE.
Click New Integration.
Set the following values:
Name: ServiceNow Incidents
Type: Incident
Template: ServiceNow Incident

Copy the generated Webhook URL.
2. Test the integration with cURL
Use the following curl command to test sending incident data from ServiceNow. Replace YOUR_URL with the URL you copied from AI SRE.

3. Configure the payload in AI SRE
Configure the payload in AI SRE with the following steps:
In AI SRE, go to the newly created ServiceNow Incidents integration.
Click Payload Configuration.
Click Refetch Payload to load the fields.
Select all available values for use in AI SRE.

Data mapping: ServiceNow to AI SRE
1
New
New
2
In Progress
Investigating
3
On Hold
Monitoring
4
Resolved
Closed
5
Closed
Closed
6
Canceled
Closed
1
Critical
SEV0:Critical
2
High
SEV1:Major
3
Moderate
SEV2:Moderate
4
Low
SEV3:Minor
5
Planning
SEV4:Cosmetic
Create webhooks in ServiceNow
Send data from ServiceNow to Harness AI SRE using a Business Rule and RESTMessageV2. This integration enables automatic incident creation and updates in Harness AI SRE when ServiceNow incidents are created or modified.
Setup instructions
Configure the incident Business Rule with the following steps:
Go to Business Rules
Go to System Definition > Business Rules.
Click New.
Configure the Business Rule
Name:
Send Incident to Harness AI SRETable:
IncidentActive: ✅
Advanced: ✅
Set when to run
When:
AfterInsert: ✅
Update: ✅
(Optional) Add filter conditions to limit which incidents trigger the webhook
Add the script
Go to the Advanced tab and paste the following:
Test the integration
Verify the incident webhook with the following steps:
Create a test incident
Create a new incident in ServiceNow to trigger the business rule.
Check system logs
Go to System Logs > All.
Confirm log output containing "AI SRE webhook payload" and response information.
Verify in Harness AI SRE
Log in to your Harness AI SRE account.
Go to the Incidents section.
Confirm the incident was created with the correct data.
Sync from ServiceNow to AI SRE
To enable bidirectional synchronization where ServiceNow comments and work notes are automatically sent to AI SRE, create an additional Business Rule that triggers when journal entries are added to incidents.
Create the journal entry Business Rule
This Business Rule automatically pushes comments and work notes from ServiceNow to AI SRE, ensuring both systems stay synchronized even when updates are made directly in ServiceNow.
Setup instructions
Configure the journal entry Business Rule with the following steps:
Go to Business Rules
Go to System Definition > Business Rules.
Click New.
Configure the Business Rule
Name:
Sync Comments to Harness AI SRETable:
Journal Entry [sys_journal_field]Active: ✅
Advanced: ✅
Set when to run
When:
AfterInsert: ✅
(Optional) Add filter conditions to limit to specific journal types
Add the script
Go to the Advanced tab and paste the following script:
Configuration notes
Keep these configuration notes in mind:
Optional filtering
The script includes commented lines that filter for only
work_notesandcomments.Uncomment these lines (remove
//) to limit synchronization to these specific journal types:
Table configuration
This Business Rule must be created on the
sys_journal_fieldtable.It triggers when journal entries (comments, work notes, etc.) are added to any record.
The script filters for incident-related entries automatically.
Endpoint substitution guide
Use this guide to correctly substitute the placeholders in the webhook endpoint used by the Business Rule. The full path is one URL; it is shown across lines here only for readability:
<ACCOUNT_ID>: Your Harness account identifier.<ORG_ID>: The organization identifier in which AI SRE is configured.<PROJECT_ID>: The project identifier that contains your AI SRE runbooks/incidents.<TEMPLATE_ID>: The incident template identifier used for this ServiceNow sync.
Recommended ways to obtain values:
Copy from AI SRE: In AI SRE, open the relevant integration/template and copy the generated webhook URL. It already includes all identifiers. Paste it into
r.setEndpoint(...).From UI URLs/settings: When viewing your org or project in Harness, the URL path shows
orgs/<ORG_ID>/projects/<PROJECT_ID>. Account ID is available in account settings. The template ID is visible in the incident template details or within the generated webhook URL.
Example (for illustration only; the real value is a single line):
Test the integration
Verify the journal entry webhook with the following steps:
Create a test comment
Open an existing incident in ServiceNow.
Add a comment or work note.
Check the system logs for webhook activity.
Verify system logs
Go to System Logs > All.
Look for entries containing "[Harness IR]" to track the webhook execution.
Confirm successful HTTP 200 responses.
Check AI SRE
Go to the corresponding incident in AI SRE.
Verify that the comment or work note appears in the incident timeline.
Next steps
Jira Integration: Configure Jira actions for runbooks.
Microsoft Teams Integration: Send incident notifications to Teams.
Runbooks Overview: Return to the runbooks overview.
Last updated
Was this helpful?