skills/itsm/natural-language-queries/SKILL.md
Master natural language search patterns to query ServiceNow without complex encoded queries
npx skillsauth add happy-technologies-llc/happy-servicenow-skills natural-language-queriesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Natural language search allows you to query ServiceNow using plain English instead of complex encoded queries. This skill teaches you how to leverage the NL search capabilities for faster, more intuitive data retrieval.
itil or admin role)Natural language search translates plain English queries into ServiceNow encoded queries. Start with simple queries and build complexity.
Basic NL Search:
Tool: SN-NL-Search
Parameters:
table_name: incident
query: show me active high priority incidents
limit: 10
Equivalent Encoded Query:
active=true^priority=1
The NL engine supports several query patterns. Master these for effective searching.
| Natural Language | Encoded Query | Description |
|------------------|---------------|-------------|
| priority is 1 | priority=1 | Exact match |
| priority equals Critical | priority=1 | Label-to-value mapping |
| state not equals Closed | state!=7 | Negation |
| priority greater than 2 | priority>2 | Greater than |
| priority less than 3 | priority<3 | Less than |
Example:
Tool: SN-NL-Search
Parameters:
table_name: incident
query: incidents where priority is 1 and state not equals Closed
limit: 20
| Natural Language | Encoded Query | Description |
|------------------|---------------|-------------|
| description contains network | descriptionLIKEnetwork | Contains text |
| short description starts with Error | short_descriptionSTARTSWITHError | Prefix match |
| description ends with timeout | descriptionENDSWITHtimeout | Suffix match |
| description does not contain test | descriptionNOTLIKEtest | Does not contain |
Example:
Tool: SN-NL-Search
Parameters:
table_name: incident
query: incidents where description contains database and short description starts with Error
limit: 10
| Natural Language | Encoded Query | Description |
|------------------|---------------|-------------|
| assigned to John Smith | assigned_to=<sys_id> | User assignment |
| assigned to is empty | assigned_toISEMPTY | Unassigned |
| assigned to is not empty | assigned_toISNOTEMPTY | Assigned |
| assignment group is Network | assignment_group=<sys_id> | Group assignment |
Example:
Tool: SN-NL-Search
Parameters:
table_name: incident
query: active incidents where assigned to is empty and priority is 1
limit: 10
| Natural Language | Encoded Query | Description |
|------------------|---------------|-------------|
| created today | sys_created_onONToday@javascript:... | Today's records |
| created yesterday | sys_created_onONYesterday@javascript:... | Yesterday |
| created last 7 days | sys_created_onONLast 7 days@javascript:... | Last week |
| updated last 24 hours | sys_updated_onRELATIVEGE@hour@ago@24 | Recent updates |
| resolved this month | resolved_atONThis month@javascript:... | This month |
Example:
Tool: SN-NL-Search
Parameters:
table_name: incident
query: high priority incidents created last 7 days
limit: 20
| Natural Language | Encoded Query | Description |
|------------------|---------------|-------------|
| priority is 1 AND state is New | priority=1^state=1 | Both conditions |
| priority is 1 OR priority is 2 | priority=1^ORpriority=2 | Either condition |
| NOT priority is 5 | priority!=5 | Exclusion |
Example:
Tool: SN-NL-Search
Parameters:
table_name: incident
query: incidents where priority is 1 or priority is 2 and state is New
limit: 15
| Natural Language | Encoded Query | Description |
|------------------|---------------|-------------|
| sort by priority | ORDERBYpriority | Ascending order |
| sort by priority descending | ORDERBYDESCpriority | Descending order |
| order by created date descending | ORDERBYDESCsys_created_on | Newest first |
Example:
Tool: SN-NL-Search
Parameters:
table_name: incident
query: active incidents sort by priority descending
limit: 25
Combine patterns for sophisticated searches.
Complex Query Example:
Tool: SN-NL-Search
Parameters:
table_name: incident
query: active high priority incidents assigned to is empty created last 7 days where description contains network sort by created date descending
limit: 20
fields: number,short_description,priority,state,sys_created_on
Before executing, validate your NL query translates correctly.
Validate Query:
Tool: SN-NL-Query-Builder
Parameters:
natural_query: active incidents where priority is 1 and assigned to is empty
Returns:
active=true^priority=1^assigned_toISEMPTY
Use the returned encoded query to verify accuracy before searching large datasets.
Use Natural Language When:
Use Encoded Queries When:
| Tool | Purpose |
|------|---------|
| SN-NL-Search | Execute natural language searches directly |
| SN-NL-Query-Builder | Convert NL to encoded query for validation |
| SN-Query-Table | Execute encoded queries for precision |
For REST API access, first use SN-NL-Query-Builder to get the encoded query, then:
| Endpoint | Method | Purpose |
|----------|--------|---------|
| /api/now/table/{table} | GET | Query with sysparm_query parameter |
SN-NL-Query-Builder to check query translation before large searchesfields parameter to reduce response payloadlimit values to avoid overwhelming resultsSymptom: NL query returns different results than expected
Cause: Ambiguous language or unsupported pattern
Solution: Use SN-NL-Query-Builder to see the actual encoded query, then adjust natural language
Symptom: Query ignores a field condition
Cause: Field name not mapped to NL patterns
Solution: Use the actual field name (e.g., assigned_to instead of assignee)
Symptom: Date-based queries return empty results
Cause: Ambiguous date reference (e.g., "yesterday" vs "last day")
Solution: Use explicit patterns: created today, created last 7 days, updated last 24 hours
Symptom: OR conditions not applied correctly
Cause: NL parser has limited OR support
Solution: For complex OR logic, use SN-NL-Query-Builder then modify the encoded query manually
| Natural Language | Field | Values |
|------------------|-------|--------|
| high priority | priority | 1, 2 |
| critical priority | priority | 1 |
| new | state | 1 |
| in progress | state | 2 |
| on hold | state | 3 |
| resolved | state | 6 |
| closed | state | 7 |
| active | active | true |
| Natural Language | Field | Values |
|------------------|-------|--------|
| emergency | type | emergency |
| normal | type | normal |
| standard | type | standard |
| draft | state | -5 |
| assess | state | -4 |
| authorize | state | -3 |
| scheduled | state | -2 |
| implement | state | -1 |
| review | state | 0 |
| closed | state | 3 |
| canceled | state | 4 |
| Natural Language | Field | Values |
|------------------|-------|--------|
| new | state | 1 |
| assess | state | 2 |
| root cause analysis | state | 3 |
| fix in progress | state | 4 |
| resolved | state | 5 |
| closed | state | 6 |
Find active P1 incidents:
Tool: SN-NL-Search
Parameters:
table_name: incident
query: active incidents with priority 1
fields: number,short_description,state,assigned_to
limit: 10
Find unassigned high priority work:
Tool: SN-NL-Search
Parameters:
table_name: incident
query: active incidents where priority is 1 or priority is 2 and assigned to is empty
fields: number,short_description,priority,sys_created_on
limit: 20
Find recent emergency changes:
Tool: SN-NL-Search
Parameters:
table_name: change_request
query: emergency changes created last 7 days
fields: number,short_description,state,start_date,end_date
limit: 15
Find network-related problems:
Tool: SN-NL-Search
Parameters:
table_name: problem
query: problems where description contains network and state not equals closed sort by priority
fields: number,short_description,state,priority
limit: 10
Validate a complex query before execution:
Tool: SN-NL-Query-Builder
Parameters:
natural_query: active high priority incidents assigned to Network Team created today
Returns: active=true^priority IN (1,2)^assignment_group=<network_team_sys_id>^sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()
itsm/incident-triage - Incident triage and prioritizationitsm/quick-reference - ITSM quick reference cardadmin/generic-crud-operations - Basic table operationstesting
Manage supplier onboarding, qualification, performance monitoring, and offboarding with auditable lifecycle controls
tools
Identify emerging risks, prioritize intake signals, and route candidates into formal GRC risk assessment workflows
documentation
Screen inbound documents for completeness, policy risk, and routing readiness before extraction or case workflows
testing
Generate concise task summaries with status, timeline, blockers, SLA risk, and recommended next actions