@servicenow/sdk — Release Notes
Version: 4.10.0
Availability: npm — https://www.npmjs.com/package/@servicenow/sdk
🚀 Overview
Version 4.10.0 adds a new StateModel API for defining state machines on change_request, problem, and other tables, a now-sdk cicd CLI command for driving app repo install/publish/rollback and ATF test suites, and Service Catalog dependent questions — alongside a large batch of transform and build pipeline reliability fixes across scheduled scripts, ACLs, tables, and business rules.
State Management
StateModel API
A new API for defining a table's states, transitions, and gating conditions in one place. A single StateModel() call produces the model record plus all of its state, transition, and condition records, and can also edit out-of-the-box models in place by referencing their real sys_ids.
import { StateModel } from '@servicenow/sdk/core'
StateModel({
$id: Now.ID['simple-change-model'],
name: 'Simple Change Model',
table: 'change_request',
states: {
new: { $id: Now.ID['state-new'], label: 'New', value: '-5', initial: true },
assess: { $id: Now.ID['state-assess'], label: 'Assess', value: '-4' },
closed: { $id: Now.ID['state-closed'], label: 'Closed', value: '3' },
},
transitions: [
{ $id: Now.ID['t-new-to-assess'], from: 'new', to: 'assess' },
{
$id: Now.ID['t-assess-to-closed'],
from: 'assess',
to: 'closed',
conditions: [
{ $id: Now.ID['cond-required'], name: 'Required fields', condition: 'short_descriptionISNOTEMPTY^EQ' },
],
},
],
})CI/CD
now-sdk cicd command
Wraps the sn_cicd API so app repo install/publish/rollback and ATF test suite runs can be driven directly from the CLI — useful for scripting promotion pipelines outside of now-sdk build/install.
now-sdk cicd install --app-sys-id <sys_id> --app-version 1.0.0
now-sdk cicd publish --scope x_myco_app --app-version 1.0.1
now-sdk cicd testsuite run --test-suite-name "My Test Suite"Service Catalog
Dependent questions
Catalog variables now support dependent questions — a variable's visibility or options can depend on the value of another variable.
Type System
$override supports sys_domain and other sys_* fields on any table
$override can now be used to set sys_domain and most other sys_* columns on any Fluent API, not just specific ones. sys_domain also gets special round-trip handling: if an existing record's domain isn't the default "global", it's automatically captured into $override the first time that record is transformed.
ATF Testing
- Added support for authoring and running list steps in ATF tests.
- Added surface support for the
runServerSideScriptstep in Script Include ATF tests.
Bug Fixes
Scheduled Scripts
- Fixed a timezone default mismatch that could shift
run_startduring round-trip — an empty/floating timezone is now treated as UTC consistently in both directions. - Fixed an "Invalid time value" crash when a timezone conversion landed exactly on midnight.
- Fixed midnight (
00:00:00) execution times being dropped instead of preserved. - Removed incorrect defaults for
entered_time,run_weekinmonth, andrun_monththat didn't match the platform's actual database defaults.
Tables & Columns
- Added many-to-many relationship (
mtom) attribute support to reference columns. - Table access policy fields are now only written when explicitly defined, instead of always being emitted.
- Column
max_lengthnow defers to the instance's install-time default instead of the SDK guessing a value. - Fixed build failures related to
sys_ux_macroponentcategories on non-standard platform values. - Tightened the criteria for emitting
sys_documentationon build to avoid unnecessary noise.
ACLs & Business Rules
- Stopped incorrectly inferring
add_messagefrom a Business Rule'smessagefield. - Added icon field support to
UiActionand fixed aclientboolean handling bug in build.
Record API
- Reference columns are now inferred from table schema, and view fields resolve correctly by name.
- Numeric-literal choice field values (e.g. a schema resolving to a union of number literals) are now coerced correctly instead of being missed.
Forms
- Fixed
$metaonFormnot being usable to control output directory.
Transform / Build Pipeline
- Fixed a catalog client script
ordermapping bug. - Preserved label overrides on inherited table fields during transform.
local_or_existingis now omitted correctly when not present in the source record.
Playbooks
Start with delay via schedule
An activity's startWithDelay can now reference a schedule record (cmn_schedule) instead of only a fixed duration or relative datetime:
startWithDelay: {
type: 'explicit',
duration: { hours: 1 },
timerSchedule: 'my_schedule_name',
}