ServiceNow integration for Grafana IRM
The ServiceNow integration enables bidirectional synchronization between alert groups in Grafana IRM and incidents in ServiceNow. Use it to automate incident creation, status updates, and resolution note sharing across both systems.
Whether your alerts originate from ServiceNow or another integration like Alertmanager or Grafana Alerting, you can manage updates and status changes directly from ServiceNow.
With this integration, you can:
- Automatically create a ServiceNow incident when an alert group is created in IRM
- Update the ServiceNow incident state when the alert group status changes
- Automatically create an alert group in IRM when a ServiceNow incident is created
- Update the alert group status when the ServiceNow incident state changes
Note
By default, only alert group statuses and ServiceNow incident states are synced automatically, based on your configured status mapping. Other fields and updates are not automatically synchronized. To sync resolution notes and work notes between systems, refer to the Enable bidirectional note sync section in this document.
Before you begin
Warning
Do not use an admin account to set up the ServiceNow integration. Instead, create a dedicated service account as described in this section.
Before configuring the integration, ensure you or your ServiceNow Admin have created a Service account specifically for Grafana IRM integration.
To create a ServiceNow user for Grafana IRM:
- In ServiceNow, navigate to User Administration > Users, and click New
- Provide the following information:
- Username:
grafana-irm
- First name:
Grafana IRM
- Active: Enabled
- Web service access only: Enabled
- Username:
- Click Set Password to generate a password and securely store it.
- In the Roles tab, assign the following roles:
itil
– Required for incident creation and updatespersonalize_choices
– Required to fetch the list of available incident states
Configure the integration
To create the integration in Grafana IRM:
- In Grafana IRM, navigate to IRM > Integrations > Monitoring Systems
- Click + New integration
- Select ServiceNow from the list
- Enter a name and description
- Provide your ServiceNow instance URL, username, and password for the service accoun of your Grafana IRM user
- Ensure Create default outgoing webhooks is enabled to create necessary webhooks in Grafana IRM for sending alerts to ServiceNow
- Click Create integration
Map incident states
Define how ServiceNow incident states map to Grafana IRM alert group statuses.
Example mappings:
Firing -> New
Acknowledged -> In Progress
Resolved -> Resolved
Silenced -> Not Selected
You can customize these mappings based on your workflows.
Generate Business Rule script
To send updates from ServiceNow back to IRM, install a Business Rule script:
Note
You can’t view the script again after closing the dialog, but you can regenerate it at any time in integration settings.
- Generate a new ServiceNow Business Rule script and copy it to your clipboard
- In ServiceNow, navigate to System Definition > Business Rules and click New
- Fill in the following details:
- Name:
grafana-irm
- Table:
incident
- Active: Enabled
- Advanced: Enabled
- When to run > When:
before
- When to run > Insert: Enabled
- When to run > Update: Enabled
- Advanced > Script: Paste the generated script
- Name:
- Click Submit to save the Business Rule
Then return to Grafana IRM and click Proceed to complete the setup.
Enable bidirectional note sync
When a resolution note is added to an alert group in IRM, it is sent as a work note to the linked ServiceNow incident.
When a work note is added to a ServiceNow incident, it is back-synced to the linked alert group as a resolution note.
The bidirectional note sync requires the Resolution note added
webhook.
- If your integration was created in version
v0.42.0
or later, the webhook is included by default. - If created before v0.42.0, you must manually add the webhook:
- Open the ServiceNow integration in Grafana IRM.
- Go to the Outgoing tab.
- Add a new webhook with the trigger type
Resolution note added
.
Test the integration
- Create an incident in ServiceNow
- Verify that a new alert group appears in Grafana IRM
- Acknowledge the alert group in Grafana IRM
- Verify that the ServiceNow incident state is updated
- Resolve the incident in ServiceNow
- Verify that the alert group status in IRM is changed to Resolved
Connect other integrations
You can connect additional alert sources like Grafana Alerting or Alertmanager to your ServiceNow integration for centralized workflows.
- Alerts from connected integrations are forwarded to ServiceNow.
- If Backsync is enabled, updates in ServiceNow reflect in IRM and the connected integration.
- All connected integrations share the same ServiceNow credentials and outgoing webhooks.
To connect another integration:
- In Grafana IRM, open your ServiceNow integration and go to the Outgoing tab
- Under Send data from other integrations, select the integration you want to connect
- Enable Backsync for bidirectional updates
- If disabled, Grafana IRM will only send alerts to ServiceNow, but not receive updates back
- Test by triggering a demo alert and verifying synchronization in both systems
Advanced usage
Customize outgoing webhooks
You can modify outgoing webhook behavior by editing them on the Outgoing tab.
Add custom incident fields
To include custom fields in ServiceNow incidents, update the Alert group created webhook’s Data template.
Example: Set the urgency
field based on alert group labels:
{
...,
"urgency": "{{ alert_group.labels.urgency }}"
}
ServiceNow incident variables for notification templates
When you customize notification templates for ServiceNow integrations, you can include ServiceNow incident details using the following variables:
{{ external_id }}
– The ServiceNow incident ID.{{ external_link }}
– A direct link to the ServiceNow incident in ServiceNow.
Note
These variables are only available after the webhook links the alert group to the ServiceNow incident.
To ensure these variables are populated in your notifications, add a delay of at least 1 minute in your escalation chain before sending notifications.