jsonv2 wraps the legacy *_list.do?JSONv2 web service. Unlike the Table API, JSONv2 exposes Service Catalog variables via displayvariables, and its write operations bypass client-side validation — useful for batch fixes and catalog cleanup, but easy to misuse. Destructive actions require --confirm.
jsonv2
Legacy JSONv2 web service — reads + writes that bypass Table API validation. Use sparingly.
sn jsonv2 <table> --action <name> [flags] Invoke a JSONv2 action against a table.
Arguments
| Name | Required | Description |
|---|---|---|
| table | Yes | The target table (e.g. incident). |
Flags
| Flag | Default | Description |
|---|---|---|
| --action <name> | — | get | get-records | get-keys | insert | insert-multiple | update | delete-record | delete-multiple |
| --sys-id <id> | — | Record sys_id (get, delete-record). |
| --query <q> | — | Encoded query (get-records, update, delete-multiple). |
| --data <json|@file> | — | Payload for insert / update (JSON literal or `@path`). |
| --display-values true|all | — | Resolve reference fields to display values. |
| --variables | — | Include Service Catalog variables (SC tables). |
| --view <name> | — | Restrict fields to a form view. |
| --limit <N> | — | Cap result count (get-records). |
| --confirm | — | Required for destructive write actions. |
Examples
sn jsonv2 sc_req_item --action get --sys-id abc123 --variables{
"records": [
{
"sys_id": "abc123",
"number": "RITM0010016",
"variables": { "hardware_model": "MacBook Pro 16", "ram": "32" }
}
]
}
sn jsonv2 sys_script --action update --query "active=true^name=BadRule" --data '{"active":"false"}' --confirm{
"records": [ { "sys_id": "def456", "__status": "success" } ]
}
JSONv2 write operations bypass Table API validation. Per-record failures are reported as __status: "failure" inside a 200 response — inspect the output.