Skip to content

How the ServiceNow Integration Works

This page explains how the ServiceNow integration behaves internally: how data flows between Qualytics and ServiceNow, what is synced, state mappings, and how fields are mapped.

Integration Flow Diagram

The following diagram illustrates how data flows from Qualytics to ServiceNow:

flowchart TB
    subgraph Qualytics["Qualytics Platform"]
        A[Anomaly Detected] --> B{User Action}
        B -->|Create Ticket| C[Create Ticket Request]
        B -->|Acknowledge| D[Status Change Event]
        B -->|Add Comment| E[Comment Event]
        B -->|Archive/Resolve| F[Resolution Event]
    end

    subgraph Background["Background Processing"]
        C --> G[Qualytics API]
        D --> H[Sync Worker]
        E --> I[Sync Worker]
        F --> J[Sync Worker]
    end

    subgraph ServiceNow["ServiceNow Instance"]
        G -->|POST /incident| K[New Incident Created]
        H -->|PATCH /incident| L[Work Note Added]
        I -->|PATCH /incident| L
        J -->|PATCH /incident| M[Resolution Work Note]
    end

    K --> N[Ticket Link Stored]
    N --> O[Anomaly & Ticket Linked]

What Gets Synced

The current release supports one-way synchronization from Qualytics to ServiceNow.

Direction Action Result Status
Qualytics → ServiceNow Create ticket from anomaly New incident created with anomaly details
Qualytics → ServiceNow Acknowledge anomaly Work note added to incident with status change
Qualytics → ServiceNow Archive anomaly (resolve) Work note added to incident with resolution status
Qualytics → ServiceNow Add comment to anomaly (standalone, on a specific change, or a reply) Comment pushed to incident as a work note
Qualytics → ServiceNow Link existing ticket Anomaly details appended to incident description; work note added with linkage info
Qualytics → ServiceNow Update Ticket Status Flow action Incident state set to the target status
ServiceNow → Qualytics Change incident state Not reflected, anomaly status unchanged
ServiceNow → Qualytics Add work notes or comments Not reflected, comments do not appear in Qualytics
ServiceNow → Qualytics Close or resolve incident Not reflected, anomaly remains in current state

Authentication

The ServiceNow integration uses Basic Authentication with a ServiceNow username and password. The credentials must belong to a dedicated service account with the itil role assigned, so Qualytics can create and update Incident records on its behalf.

See the Configure ServiceNow and Add Connection guides for the full setup flow.

ServiceNow State Mappings

ServiceNow uses numeric state values for incidents. Understanding these states helps when working with the integration:

State Code State Name Name recognized by Qualytics Description
1 New Yes Incident has been created but not yet worked on
2 In Progress Yes Work is actively being done on the incident
3 On Hold Yes Incident is waiting for external input or resources
4 Awaiting User Info No Incident is paused awaiting input from the requester
5 Awaiting Problem No Incident is awaiting resolution of a related problem
6 Resolved Yes The issue has been fixed or addressed
7 Closed Yes Incident is complete and verified
8 Canceled Yes Incident was canceled without resolution

The Status field accepts either the numeric code or one of the six recognized names. States 4 and 5 have to be given as their code, and an incident already sitting in one of them reads back in Qualytics as Unknown (4) or Unknown (5) rather than by name.

One-Way State Updates

Qualytics does not automatically update anomaly status based on ServiceNow state changes. This design prevents synchronization loops and maintains clear ownership: ServiceNow is the "ticket of record" while Qualytics is the "anomaly of record."

Field Mapping Reference

Incident Fields Supported

When creating a ticket from Qualytics, the following ServiceNow Incident fields can be populated:

Field Name ServiceNow Field Required Notes
Short Description short_description Yes Brief summary of the issue
Description description No Detailed description. Anomaly details are added automatically
Status state No The state the incident starts in. Defaults to New
Priority priority No Values: Critical, High, Moderate, Low, Planning. Defaults to Moderate
Urgency urgency No High, Medium, or Low. Defaults to Low
Impact impact No High, Medium, or Low. Defaults to Low
Category category No Must match exact category name in ServiceNow
Subcategory subcategory No Must match exact subcategory name
Assignment Group assignment_group No Requires the sys_id of the group, not its name
Assigned To assigned_to No Requires the sys_id of the user, not a username or display name. A value ServiceNow cannot resolve leaves the incident unassigned

Auto-Populated Fields

The following fields are automatically populated by Qualytics when creating a ticket:

Field Auto-Populated Value
Description (body) Anomaly ID, type, status at detection, field/check message, failed checks, hyperlink back to Qualytics anomaly
Caller Currently uses service account (user-based caller not yet supported)
Work Notes (on updates) Status changes (acknowledge, archive) and comments from Qualytics with timestamps

Key Integration Operations

Create Ticket

Creates a ServiceNow incident from a Qualytics anomaly with:

  • Required field: short_description
  • Optional fields: description, state, priority, urgency, impact, category, subcategory, assignment_group, assigned_to
  • Set by the integration: the record is always created on the Incident table, by the integration's service account; the caller cannot be set from Qualytics
  • Auto-included: Anomaly ID, status, type, failed checks, and hyperlink back to the Qualytics anomaly (appended to the description)

When the starting state is Resolved, Closed, or Canceled, a close code and close note are filled in automatically, because ServiceNow requires them on those states.

Links an existing ServiceNow incident to an anomaly:

  • Appends anomaly details to the existing description
  • Adds a work note about the linkage

Sync Anomaly Status

When anomaly status changes in Qualytics:

  • Adds a timestamped work note to the linked ServiceNow incident
  • Example: [2024-01-15 10:30:00 UTC] Qualytics Anomaly Status: Acknowledged

Note

Status changes add work notes but do not change the incident's state. This preserves ITSM workflow control.

Sync Comments

When comments are added to anomalies in Qualytics:

  • The comment text is synced to linked tickets as work notes
  • Example: Comment from Qualytics: <user's comment>

The work note carries the comment as plain text, so a mention arrives as a raw text code rather than as the formatted name you saw when typing it, and the mentioned user is notified in Qualytics only. A reply arrives as its own work note with no indication of which comment it answers, because work notes are a flat list. The anomaly's Timeline in Qualytics keeps the full thread with its structure.

Supported Features & Capabilities

Current Release Features

Feature Status
Create Incident from anomaly
Link existing Incident to anomaly
Link multiple tickets to one anomaly
Sync anomaly acknowledge to ServiceNow
Sync anomaly archive (resolve) to ServiceNow
Push comments to ServiceNow work notes
Hyperlink from ServiceNow back to Qualytics anomaly
Basic Authentication (username/password)
Search existing ServiceNow tickets
Create an incident automatically from a Flow
Change the incident state from Qualytics (Flow action)

Known Limitations

Feature Status
Two-way sync (ServiceNow → Qualytics)
See ServiceNow ticket state changes in Qualytics
Drop-down fields populated from ServiceNow
Multiple ServiceNow instances
Ticket types other than Incident (Defect, Enhancement, etc.)
Set the caller on a new incident
Change the incident state on an anomaly status change
OAuth 2.0 authentication
HashiCorp Vault credential storage