preview_ci_update
Preview changes to a CI record by computing a diff against proposed field updates. Returns a confirmation token valid for 5 minutes to later confirm the update.
Instructions
Preview changes to an existing CI before applying them.
Fetches the current record, computes a diff against the proposed changes, and returns a confirmation token. No changes are made to ServiceNow.
The confirmation token is valid for 5 minutes. Pass it to confirm_ci_update to execute the change.
Prerequisites: Use search_cis or get_ci_details to find the CI sys_id first.
Typical workflow: preview_ci_update → review diff → confirm_ci_update
Examples: preview_ci_update(sys_id="abc123...", table="cmdb_ci_server", fields={ "operational_status": "6" }) # Retire a server preview_ci_update(sys_id="abc123...", table="cmdb_ci_server", fields={ "ip_address": "10.0.2.10", "short_description": "Moved to new subnet" }) preview_ci_update(sys_id="abc123...", table="cmdb_ci_linux_server", fields={ "install_status": "7", "operational_status": "2" }) # Mark as decommissioned
Args: sys_id: The sys_id of the CI to update. table: The CMDB table (e.g. cmdb_ci_server). Must be the specific class table. fields: Dictionary of field names to new values. Example: {"operational_status": "2", "install_status": "7"}. System fields (sys_id, sys_created_on, etc.) cannot be set.
Returns: JSON object with "token" (confirmation token), "sys_id", "table", "diff" (list of field changes with old/new values), and "fields" (proposed values).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sys_id | Yes | ||
| table | Yes | ||
| fields | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |