Connectors ServiceNow

ServiceNow

API

The ServiceNow connector is an API connector for ServiceNow ITSM. It fetches incidents and change requests via the Table API and produces structural claims for state, priority, assignee, and category. Text extraction runs on descriptions and close notes.

How it works

Claim patterns

SubjectPredicateObject
(INC number, incident)assigned_to(name, person)
(INC number, incident)has_state(state, status)
(INC number, incident)has_priority(priority, level)
(INC number, incident)categorized_as(category, category)
(INC number, incident)opened_by(name, person)

1 Get ServiceNow instance credentials

You need a ServiceNow instance URL (e.g. mycompany.service-now.com) and either basic auth credentials (username + password) or an OAuth token with read access to the tables you want to query.

2 Install requests

$ pip install requests

3 Connect

conn = db.connect("servicenow",
    instance="mycompany.service-now.com",
    username=os.environ["SNOW_USER"],
    password=os.environ["SNOW_PASS"],
)
result = conn.run(db)
Parameter Required Default Description
instance Yes ServiceNow instance hostname (e.g. mycompany.service-now.com)
username No* Username for basic auth (*required if token not provided)
password No* Password for basic auth (*required if token not provided)
token No* OAuth Bearer token (*alternative to username/password)
tables No ["incident", "change_request"] List of ServiceNow tables to query
query No None Encoded query string for server-side filtering
max_items No 500 Maximum number of records to fetch per table
extraction No heuristic Text extraction mode for descriptions: heuristic or llm
save No False Encrypt and persist credentials

Basic usage

conn = db.connect("servicenow",
    instance="mycompany.service-now.com",
    username=os.environ["SNOW_USER"],
    password=os.environ["SNOW_PASS"],
)
result = conn.run(db)
print(f"Ingested {result.claims_ingested} claims")

With query filter

conn = db.connect("servicenow",
    instance="mycompany.service-now.com",
    username=os.environ["SNOW_USER"],
    password=os.environ["SNOW_PASS"],
    tables=["incident"],
    query="state=1^priority=1",
    max_items=100,
)
result = conn.run(db)

With OAuth token

conn = db.connect("servicenow",
    instance="mycompany.service-now.com",
    token=os.environ["SNOW_OAUTH_TOKEN"],
    extraction="llm",
    save=True,
)
result = conn.run(db)

Related Connectors