首页龙虾技能列表 › ServiceNow — ServiceNow

🔧 ServiceNow — ServiceNow

v1.1.0

ServiceNow 服务管理工具。

0· 582·0 当前·0 累计
by @onlyflowstech (OnlyFlows)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/2/26
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The skill's files, instructions, and required environment variables are coherent with a ServiceNow Table API integration and do not request unrelated credentials or install arbitrary third‑party code.
评估建议
This skill appears to do exactly what it says: it makes REST calls to the ServiceNow instance you point it at using the SN_USER/SN_PASSWORD you provide. Before installing, verify the skill source (registry lists homepage onlyflows.tech but registry source is 'unknown' — consider checking the GitHub repo referenced in the README), and: use a dedicated, least‑privilege integration account (not an admin); prefer non-password auth (OAuth or scoped API accounts) if your instance supports it; rotate c...
详细分析 ▾
用途与能力
Name and description (ServiceNow Table/Stats API CRUD, schema, attachments) match the included scripts and SKILL.md; required binaries (curl, jq) and env vars (SN_INSTANCE, SN_USER, SN_PASSWORD) are appropriate for the stated purpose.
指令范围
Runtime instructions and the provided shell script only reference ServiceNow endpoints constructed from SN_INSTANCE and use the declared env vars; they do not read other system credentials or call unexpected external endpoints. The script performs destructive operations (delete, batch) but requires explicit --confirm flags as described.
安装机制
This is instruction-only with bundled script files (no external download/install step). No installer that pulls arbitrary code from untrusted URLs is present.
凭证需求
The skill requests only SN_INSTANCE, SN_USER, and SN_PASSWORD — the minimal credentials needed for Basic Auth against a ServiceNow instance. No unrelated tokens or system config paths are required.
持久化与权限
always is false and the skill does not request elevated platform privileges or modify other skills; it can be invoked autonomously (default) but that is expected for a service integration.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.1.02026/2/16

New tools: sn_batch (bulk operations with dry-run safety) and sn_health (instance health check — nodes, jobs, semaphores, stats). 10 tools total.

● 无害

安装命令 点击复制

官方npx clawhub@latest install servicenow
镜像加速npx clawhub@latest install servicenow --registry https://cn.clawhub-mirror.com

技能文档

Query and manage records on any ServiceNow instance via the REST Table API.

Setup

Set environment variables for your ServiceNow instance:

export SN_INSTANCE="https://yourinstance.service-now.com"
export SN_USER="your_username"
export SN_PASSWORD="your_password"

All tools below use scripts/sn.sh which reads these env vars.

Tools

sn_query — 查询 任何 表

bash scripts/sn.sh query  [options]

Options:

  • --查询 "" — ServiceNow encoded 查询 (e.g. 活跃=真^priority=1)
  • --fields "" — Comma-separated fields 到 return
  • --limit — Max records (默认 20)
  • --offset — 分页 offset
  • --orderby "<字段>" — 排序 字段 (prefix 带有 - 对于 descending)
  • --display <真|假|所有> — Display values mode

Examples:

# List open P1 incidents
bash scripts/sn.sh query incident --query "active=true^priority=1" --fields "number,short_description,state,assigned_to" --limit 10

# All users in IT department bash scripts/sn.sh query sys_user --query "department=IT" --fields "user_name,email,name"

# Recent change requests bash scripts/sn.sh query change_request --query "sys_created_on>=2024-01-01" --orderby "-sys_created_on" --limit 5

sn_get — 获取 single 记录 由 sys_id

bash scripts/sn.sh get 
[options]

Options:

  • --fields "" — Fields 到 return
  • --display <真|假|所有> — Display values mode

Example:

bash scripts/sn.sh get incident abc123def456 --fields "number,short_description,state,assigned_to" --display true

sn_create — 创建 记录

bash scripts/sn.sh create 
''

Example:

bash scripts/sn.sh create incident '{"short_description":"Server down","urgency":"1","impact":"1","assignment_group":"Service Desk"}'

sn_update — 更新 记录

bash scripts/sn.sh update 
''

Example:

bash scripts/sn.sh update incident abc123def456 '{"state":"6","close_code":"Solved (Permanently)","close_notes":"Restarted service"}'

sn_delete — 删除 记录

bash scripts/sn.sh delete 
--confirm

The --confirm flag is required to prevent accidental deletions.

sn_aggregate — Aggregate queries

bash scripts/sn.sh aggregate 
--type [options]

Types: COUNT, AVG, MIN, MAX, SUM

Options:

  • --类型 <类型> — Aggregation 类型 (必填)
  • --查询 "" — 过滤 records
  • --字段 "<字段>" — 字段 到 aggregate 在...上 (必填 对于 AVG/MIN/MAX/求和)
  • --分组-由 "<字段>" — 分组 results 由 字段
  • --display <真|假|所有> — Display values mode

Examples:

# Count open incidents by priority
bash scripts/sn.sh aggregate incident --type COUNT --query "active=true" --group-by "priority"

# Average reassignment count bash scripts/sn.sh aggregate incident --type AVG --field "reassignment_count" --query "active=true"

sn_schema — 获取 表 schema

bash scripts/sn.sh schema 
[--fields-only]

Returns field names, types, max lengths, mandatory flags, reference targets, and choice values.

Use --fields-only for a compact field list.

sn_batch — Bulk 更新 或 删除 records

bash scripts/sn.sh batch 
--query "" --action [--fields '{"field":"value"}'] [--limit 200] [--confirm]

Performs bulk update or delete operations on all records matching a query. Runs in dry-run mode by default — shows how many records match without making changes. Pass --confirm to execute.

Options:

  • --查询 "" — 过滤 records 到 operate 在...上 (必填)
  • --action <更新|删除> — Operation 到 perform (必填)
  • --fields '' — JSON fields 到 设置 在...上 每个 记录 (必填 对于 更新)
  • --limit — Max records 到 affect per run (默认 200, safety cap 在 10000)
  • --dry-run — Show match 计数 仅, 否 changes (默认 behavior)
  • --confirm — Actually execute operation (disables dry-run)

Examples:

# Dry run: see how many resolved incidents older than 90 days would be affected
bash scripts/sn.sh batch incident --query "state=6^sys_updated_on

# Bulk close resolved incidents (actually execute) bash scripts/sn.sh batch incident --query "state=6^sys_updated_on

# Dry run: count orphaned test records bash scripts/sn.sh batch u_test_table --query "u_status=abandoned" --action delete

# Delete orphaned records (actually execute) bash scripts/sn.sh batch u_test_table --query "u_status=abandoned" --action delete --limit 50 --confirm

Output (JSON summary):

{"action":"update","table":"incident","matched":47,"processed":47,"failed":0}

sn_health — Instance health check

bash scripts/sn.sh health [--check ]

Checks ServiceNow instance health across multiple dimensions. Default is --check all which runs every check.

Checks:

  • version — Instance build version, 日期, 和 tag 从 sys_properties
  • nodes — Cluster 节点 status (在线/离线) 从 sys_cluster_state
  • jobs — Stuck/overdue scheduled jobs 从 sys_trigger (state=就绪, next_action > 30 min past)
  • semaphores — 活跃 semaphores (potential locks) 从 sys_semaphore
  • stats — Quick dashboard: 活跃 incidents, 打开 P1s, 活跃 changes, 打开 problems

Examples:

# Full health check
bash scripts/sn.sh health

# Just check version bash scripts/sn.sh health --check version

# Check for stuck jobs bash scripts/sn.sh health --check jobs

# Quick incident/change/problem dashboard bash scripts/sn.sh health --check stats

Output (JSON):

{
  "instance": "https://yourinstance.service-now.com",
  "timestamp": "2026-02-16T13:30:00Z",
  "version": {"build": "...", "build_date": "...", "build_tag": "..."},
  "nodes": [{"node_id": "...", "status": "online", "system_id": "..."}],
  "jobs": {"stuck": 0, "overdue": []},
  "semaphores": {"active": 2, "list": []},
  "stats": {"incidents_active": 54, "p1_open": 3, "changes_active": 12, "problems_open": 8}
}

sn_attach — Manage attachments

# List attachments on a record
bash scripts/sn.sh attach list 

# Download an attachment bash scripts/sn.sh attach download

# Upload an attachment bash scripts/sn.sh attach upload

[content_type]

Common Tables

TableDescription
incidentIncidents
change_requestChange Requests
problemProblems
sc_req_itemRequested Items (RITMs)
sc_requestRequests
sys_userUsers
sys_user_groupGroups
cmdb_ciConfiguration Items
cmdb_ci_serverServers
kb_knowledgeKnowledge Articles
taskTasks (parent of incident/change/problem)
sys_choiceChoice list values

Encoded 查询 Syntax

ServiceNow encoded queries use ^ as AND, ^OR as OR:

  • 活跃=真^priority=1 — 活跃 和 P1
  • 活跃=真^ORactive=假 — 活跃 或 非活跃
  • short_descriptionLIKEserver — Contains "server"
  • sys_created_on>=2024-01-01 — Created 之后 日期
  • assigned_toISEMPTY — Unassigned
  • stateIN1,2,3 — State 1, 2, 或 3
  • caller_id.name=John Smith — Dot-walk 通过 references

Notes

  • 所有 API calls 使用 Basic Auth 通过 SN_USER / SN_PASSWORD
  • 默认 结果 limit 20 records; 使用 --limit 到 adjust
  • 使用 --display 真 到 获取 human-readable values 代替 的 sys_ids 对于 reference fields
  • script auto-detects whether SN_INSTANCE includes protocol prefix
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务