ServiceNow to xMatters: Business Service (cmdb_ci_service) + Change Intelligence Sync (change_request)
This repository contains ServiceNow update sets that synchronize:
- CMDB Business Services (
cmdb_ci_service) → xMatters Services - Change Requests (
change_request) → xMatters Change Intelligence change records
These changes enable Major Incident Managers, SREs and Devops teams to do more with services in xMatters and ServiceNow. If you’re using the Everbridge Flow Designer (EBFD) app in ServiceNow alongside xMatters, you'll benefit from shared context by having the same service names, ownership, and change history show up in the places where people are actively working on responding to and resolving incidents. With these changes you can bridge the gap between impacted services and ownership bringing clarity to Incident Commanders when delegating resolver responsibilities. Services can be connected to xMatters StatusPages and can be updated throughout the incident lifecycle from initial impact to resolution all while keeping stakeholders informed.
What you get by syncing Services and Changes (CMDB → xMatters)
- A service catalog that incident workflows can take advantage of. In xMatters Incident Management, impacted services can be connected to an incident during initiation so the incident starts with the appropriate impacted service context.
- Services can also be notified and will engage the responsible support group. Allowing Incident Commanders to focus on "what" is impacted rather than "who" do I need to notify.
- The service record in xMatters links back to the ServiceNow CI, responders can pivot straight into the CMDB record without hunting by clicking the related service link in the xMatters service view.
- Change context allows teams to review recent changes to identify potential root causes for an incident.
File: xMattersServiceCenter.xml
Includes:
- Script Includes:
xmApiClient,xm_loggerserviceBatchSync(ServiceNow services → xMatters services)changeBatchSync(ServiceNow change_request → xMatters /changes)
- Business Rules:
xM Service Sync - Insert/Update(cmdb_ci_service)xM Service Sync - Delete(cmdb_ci_service)xMatters Change Intelligence(change_request)
- Event Registrations:
x_xma_eb_fd.service.syncx_xma_eb_fd.service.deletex_xma_eb_fd.change.sync
- Script Actions:
xM Service Sync,xM Service DeletexM Change Sync,xM Change Sync create
- App table:
x_xma_eb_fd_xm_change_map(record keeping, which ensures changes only sync once when closed.)
- System property:
x_xma_eb_fd.service_and_change_sync_credential_name(default:xMattersServiceSyncupdate to use a configured credential from the EBFD application.)
- Cross-scope privileges needed by the app (included in update set):
GlideRecord.setWorkflow- Read
change_request - Write
cmdb_ci_service
File: xMatters_Service_Batch_Sync.xml
Creates scheduled job:
xMatters Service Batch Sync(Run Type: on_demand but can be set to run at a specified interval (not recommended))
File: xMatters_Change_Intelligence_Batch_Queue.xml
Creates scheduled job:
xMatters Change Intelligence Batch Queue(Run Type: on_demand but can be set to run at a specified interval (not recommended))
- Tables used:
cmdb_ci_service(Business Services)change_request
- App scope:
- Update sets are in scope of Everbridge Flow Designer ServiceNow application
x_xma_eb_fdthus the EBFD application must be installed in ServiceNow. - Network connectivity from ServiceNow MID/server-side outbound to xMatters API
- Update sets are in scope of Everbridge Flow Designer ServiceNow application
- xMatters tenant with:
- Services
- Change Intelligence
- API access and credentials/token configured
Import and commit update sets in this order:
- Core:
xMattersServiceCenter.xml - Service batch job (optional):
xMatters_Service_Batch_Sync.xml - Change batch job (optional):
xMatters_Change_Intelligence_Batch_Queue.xml
Steps (each update set):
- Navigate to System Update Sets → Retrieved Update Sets
- Click Import Update Set from XML
- Upload the XML file
- Open the retrieved update set → Preview Update Set
- Resolve any conflicts
- Commit Update Set
Note: Import may prompt for cross-scope privilege approvals depending on instance policy. The required privileges are included in the core update set.
The Script Includes instantiate xmApiClient using the system property:
- Property:
x_xma_eb_fd.service_and_change_sync_credential_name - Default value:
xMattersServiceSync
Ensure a matching credential record exists and is readable by the app.
The credential record name must match the property value, or update the property accordingly.
serviceBatchSync attempts to set ownedBy.targetName on xMatters services using the ServiceNow group name (e.g., Software).
If the group does not exist in xMatters the service will exist but not be owned in xMatters, it will be orphaned.
For the best results, ensure the ServiceNow groups you want to map as xMatters service owners exist and are ACTIVE in xMatters.
Business Rule: xM Service Sync - Insert/Update on cmdb_ci_service
Runs after insert/update when:
used_foris 'Production'
Behavior:
- Queues event
x_xma_eb_fd.service.sync - Script Action
xM Service SynccallsserviceBatchSync:- If name changed, it uses rename-aware update
- Otherwise, it performs a normal upsert (create/update)
Business Rule: xM Service Sync - Delete on cmdb_ci_service
Runs before delete:
- Queues event
x_xma_eb_fd.service.deletewith:parm1= old servicename(used as xMatters identifier)parm2= CI sys_id
- Script Action
xM Service DeletecallsserviceBatchSync.deleteServiceByTargetName()
Scheduled job: xMatters Service Batch Sync (optional)
Calls into serviceBatchSync to reconcile services in bulk.
Business Rule: xMatters Change Intelligence on change_request
Runs after update when:
active=trueclosed_atis not empty- AND the script confirms this is the first time it became closed (prevents re-queueing)
Behavior:
- Queues event
x_xma_eb_fd.change.syncwith:parm1= change sys_idparm2= origin string (e.g.,dynamic)
- Script Action
xM Change SynccallschangeBatchSync.processChangeEvent(current, event) changeBatchSyncposts to xMattersPOST /changes
Scheduled job: xMatters Change Intelligence Batch Queue (optional)
Default in XML is on_demand and queues events for recently closed changes, adjust 'lookbackDays' and 'maxToQueue' variables as needed:
new x_xma_eb_fd.changeBatchSync().runBatch({
lookbackDays: 100,
maxToQueue: 1000,
dryRun: false
});Use the steps below to validate the Scheduled Jobs and Business Rules included in this integration.
Testing: Bulk-sync all Production Business Services (cmdb_ci_service) from ServiceNow to xMatters.
- In ServiceNow, go to System Definition → Scheduled Jobs.
- Open xMatters Service Batch Sync.
- Click Execute Now.
- Open System Logs → All and confirm the run completed successfully (no REST/auth/payload errors).
- In xMatters, confirm Services exist/updated for the expected Production Business Services.
Expected results
- All qualifying Business Services are created/updated in xMatters.
Testing: Backfill closed Change Requests that may have missed real-time processing.
- In ServiceNow, go to System Definition → Scheduled Jobs.
- Open xMatters Change Intelligence Batch Queue.
- Click Execute Now.
- Open System Logs → All and confirm changes were processed successfully.
- In xMatters, confirm closed Change Requests appear as Change Intelligence records.
Expected Results
- Closed Changes are synced without duplicates.
Table: cmdb_ci_service
Condition: used_for = Production
- Create a new Business Service with Used for = Production.
- Save the record.
- Verify a corresponding Service is created in xMatters.
- Update a mapped field (e.g., Name or ownership/support group if mapped).
- Verify the update is reflected in xMatters.
Expected results
- Only Production Business Services trigger synchronization.
Table: cmdb_ci_service
- Delete a Business Service that meets the sync condition (e.g., Used for = Production).
- Review System Logs → All to confirm the delete flow executed successfully.
- Verify the corresponding Service is removed (or deactivated, depending on implementation) in xMatters.
Expected results
- Deleted Business Services are removed/deactivated in xMatters.
Table: change_request
Trigger: Change transitions to a closed state (e.g., closed_at populated)
- Create a new Change Request.
- Transition the Change to a closed state.
- Verify a Change Intelligence record appears in xMatters for the closed Change.
- Re-open the Change and close it again.
- Verify the integration does not create a duplicate Change Intelligence record.
Expected results
- Each Change is synced once upon closure.
- No duplicates are created.
- Scheduled jobs execute successfully via Execute Now
- Business Rules trigger only under expected conditions
- No duplicate Services created in xMatters
- No duplicate Change Intelligence records created
- Errors (if any) are visible and actionable in ServiceNow logs