### Install from source Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/installation.md Cloning the repository and performing an editable installation. ```bash git clone https://github.com/Knuckles-Team/servicenow-api.git cd servicenow-api pip install -e ".[all]" # editable install with every extra ``` -------------------------------- ### Installation Command Source: https://github.com/knuckles-team/servicenow-api/blob/main/AGENTS.md Installs the project and all necessary dependencies. ```bash pip install .[all] ``` -------------------------------- ### Install and run the MCP server Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/index.md Install the package with MCP support and start the stdio MCP server. ```bash pip install "servicenow-api[mcp]" servicenow-mcp # stdio MCP server (default transport) ``` -------------------------------- ### Install Application via Repository Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-cicd-devops/SKILL.md Use these parameters to initiate an app installation and subsequently poll the progress status. ```json {"sys_id":"","scope":"x_myco_app","auto_upgrade_base_app":true} ``` ```json {"progress_id":""} ``` -------------------------------- ### Install via PyPI Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/installation.md Standard installation command for the base package. ```bash pip install servicenow-api ``` -------------------------------- ### Perform initial build Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/project-init.md Installs dependencies and compiles the Fluent metadata into a deployable package. ```bash pnpm install # install @servicenow/sdk + deps now-sdk build # compile Fluent → deployable package ``` -------------------------------- ### Install and run with uv Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/installation.md Using uv for dependency management and execution. ```bash uv pip install -e ".[all]" uv run servicenow-mcp ``` -------------------------------- ### Install App from Repository Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-app-engine/references/packaging-and-publish.md Installs a specific version of a published app on a target instance using the app_repo_install action. ```json {"sys_id":"","version":"1.0.0","auto_upgrade_base_app":false,"base_app_version":""} ``` -------------------------------- ### Install servicenow-api via uv Source: https://github.com/knuckles-team/servicenow-api/blob/main/README.md Commands to install the package in different modes using the uv tool. ```bash uv tool install "servicenow-api[mcp]" ``` ```bash uv pip install -e ".[agent]" ``` -------------------------------- ### Install App from Source Control Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/deploy-and-install.md JSON payload for the app_repo_install action. ```json {"name":"","sys_id":"","auto_upgrade_base_app":false,"base_app_version":"","version":"1.0.0"} ``` -------------------------------- ### Install optional extras Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/installation.md Commands for installing specific feature sets or all available extras. ```bash pip install "servicenow-api[mcp]" ``` ```bash pip install "servicenow-api[agent]" ``` ```bash pip install "servicenow-api[all]" ``` ```bash pip install "servicenow-api[test]" ``` ```bash # Typical: run the MCP server and the A2A agent pip install "servicenow-api[all]" ``` -------------------------------- ### Install ServiceNow API extras Source: https://github.com/knuckles-team/servicenow-api/blob/main/README.md Install specific project extras using uv or pip based on the required functionality. ```bash # Connector-focused MCP server (includes the shared graph engine) uv pip install "servicenow-api[mcp]" # Agent runtime (adds model orchestration to the shared graph engine) uv pip install "servicenow-api[agent]" # Everything (development) uv pip install "servicenow-api[all]" # or: python -m pip install "servicenow-api[all]" ``` -------------------------------- ### Deploy and Install via CLI Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/deploy-and-install.md Commands for building and deploying local packages to a ServiceNow instance. ```bash now-sdk build # required first now-sdk deploy # push built package to active instance # or now-sdk install --auth # push to the profile's instance ``` -------------------------------- ### Scaffold a new project Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/project-init.md Initializes a new project directory and triggers the interactive setup prompts. ```bash mkdir my-app && cd my-app now-sdk init # answer prompts: app name, package name, scope ``` -------------------------------- ### Batch Install Multiple Apps Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-app-engine/references/packaging-and-publish.md Installs multiple applications simultaneously using the batch_install action. ```json {"name":"asset apps","packages":[{"id":"","type":"application","requested_version":"1.0.0","load_demo_data":false}]} ``` -------------------------------- ### Deploy or install the package Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/cli-commands.md Push the compiled package to the active instance. Use --auth to specify a stored profile. ```bash now-sdk deploy ``` ```bash now-sdk install ``` -------------------------------- ### Interactive basic authentication setup Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/auth-and-profiles.md Configures a new instance profile using basic authentication with an interactive password prompt. ```bash now-sdk auth --add https://.service-now.com --type basic \ --alias dev --username # prompts for password, stores it in the keychain now-sdk auth --list # show stored profiles now-sdk auth --use dev # make 'dev' the active profile ``` -------------------------------- ### now-sdk deploy / install Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/cli-commands.md Pushes the built package to the authenticated ServiceNow instance. ```APIDOC ## now-sdk deploy / install ### Description Deploys the built package to the active instance. `install` supports CI/CD flows. ``` -------------------------------- ### Verify installation Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/installation.md Commands to check the CLI help and verify the package version. ```bash servicenow-mcp --help python -c "import servicenow_api; print(servicenow_api.__version__)" ``` -------------------------------- ### servicenow_cicd: batch_install Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-app-engine/references/packaging-and-publish.md Installs multiple applications at once. ```APIDOC ## servicenow_cicd(action="batch_install") ### Description Installs several apps at once. ### Parameters - **name** (string) - Required - Name of the batch operation. - **packages** (array) - Required - List of packages to install. ### Request Example {"name":"asset apps","packages":[{"id":"","type":"application","requested_version":"1.0.0","load_demo_data":false}]} ``` -------------------------------- ### Batch Install Applications Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/deploy-and-install.md JSON payload for the batch_install action. ```json {"name":"my batch","packages":[{"id":"","type":"application","load_demo_data":false,"requested_version":"1.0.0"}]} ``` -------------------------------- ### Convert an existing application Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/project-init.md Pulls metadata from an installed scoped application to manage it as a Fluent project. ```bash now-sdk init --from ``` -------------------------------- ### Run servicenow-mcp Source: https://github.com/knuckles-team/servicenow-api/blob/main/README.md Execution command for the MCP tool after installation. ```bash servicenow-mcp ``` -------------------------------- ### Deploy and Verify Agent Server Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/deployment.md Commands to start the services and verify the health status of the agent. ```bash docker compose -f docker/agent.compose.yml up -d curl -s http://localhost:9004/health # {"status":"OK"} ``` -------------------------------- ### Start Loopback development listener Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/deployment.md Run the server on a local loopback interface for development purposes. Do not expose this listener to external networks. ```bash servicenow-mcp --transport streamable-http --host 127.0.0.1 --port 8000 ``` -------------------------------- ### servicenow_cicd: app_repo_install Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-app-engine/references/packaging-and-publish.md Installs a published version of an app on a target instance. ```APIDOC ## servicenow_cicd(action="app_repo_install") ### Description Installs a published version of an app on a target instance. ### Parameters - **sys_id** (string) - Required - The app's sys_scope/application record ID. - **version** (string) - Required - The version to install. - **auto_upgrade_base_app** (boolean) - Optional - Whether to auto-upgrade the base app. - **base_app_version** (string) - Optional - The version of the base app. ### Request Example {"sys_id":"","version":"1.0.0","auto_upgrade_base_app":false,"base_app_version":""} ``` -------------------------------- ### Docker Compose Commands Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/deployment.md Commands to initialize the environment variables and start the containerized service. ```bash cp .env.example .env # then edit SERVICENOW_* values docker compose -f docker/mcp.compose.yml up -d docker compose -f docker/mcp.compose.yml logs -f ``` -------------------------------- ### Configure Installed stdio process Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/deployment.md Use this JSON configuration to register the servicenow-mcp server for local stdio communication. ```json { "mcpServers": { "servicenow": { "command": "servicenow-mcp", "args": [], "env": {"MCP_TOOL_MODE": "intent"} } } } ``` -------------------------------- ### Configure and run the MCP server with HTTP transport Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/index.md Set environment variables for ServiceNow credentials and start the MCP server using the streamable-http transport. ```bash export SERVICENOW_INSTANCE=https://your-instance.service-now.com export SERVICENOW_USERNAME=admin export SERVICENOW_PASSWORD=your_password servicenow-mcp --transport streamable-http --host 0.0.0.0 --port 8000 ``` -------------------------------- ### Catalog Item with Topics and Access Controls Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-docs/references/service-catalog-sample.md Defines a 'Software Installation' catalog item with various configurations including topics, access restrictions, variable sets, and execution scripts. Use this for complex service requests. ```javascript export const softwareInstallation = CatalogItem({ $id: Now.ID['topic_catalog_item'], name: 'Software Installation', shortDescription: 'Request software installation', description: 'Use this form to request installation of software on your company device.', catalogs: [catalogTechnicalCatalog], categories: [categorySoftware], assignedTopics: [topicSoftware, topicHardware], meta: ['software', 'installation', 'IT'], accessType: 'restricted', availableFor: [userCriteriaItilRole], notAvailableFor: [userCriteriaDevDepartment], variableSets: [ { variableSet: userInfoVarSet, order: 100 }, { variableSet: hardwareSpecsVarSet, order: 200 }, ], executionPlan: '523da512c611228900811a37c97c2014', useScLayout: true, deliveryPlanScript: `// Custom delivery plan logic gs.info('Processing delivery plan for software installation');`, entitlementScript: `// Entitlement check return current.department.name == 'IT' || current.hasRole('admin');`, image: 'software_icon.png', icon: 'icon-software', roles: ['itil', 'admin'], variables: { shortDescription: SingleLineTextVariable({ order: 1, question: 'Short Description', }), description: MultiLineTextVariable({ order: 2, question: 'Description', }), name: RequestedForVariable({ order: 3, question: 'Requested For', }), active_user: SingleLineTextVariable({ order: 4, question: 'Active', }), company: ReferenceVariable({ order: 5, question: 'Company', referenceTable: 'core_company', }), }, }) ``` -------------------------------- ### Execute CLI commands for MCP and Agent servers Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/usage.md Commands for starting the MCP server and the A2A agent server using console scripts. ```bash # MCP server (stdio by default) servicenow-mcp servicenow-mcp --transport streamable-http --host 0.0.0.0 --port 8000 # A2A agent server (consumes the MCP tools over MCP_URL) MCP_URL=http://localhost:8000/mcp PROVIDER=openai MODEL_ID=gpt-4o \ servicenow-agent ``` -------------------------------- ### Expose 'require' for Cross-Scope Module Loading Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-docs/references/sys_module-sample.md This example demonstrates how to expose the 'require' function via a script include to load modules from other scopes. Ensure the `api_name` property is set to your application's scope. ```javascript // ES6+: const { methodA, propertyB } = x_snc_scope_name.x_require("full/path/of/es_module/in/sys_module/table"); // ES5: var myModule = x_snc_scope_name.x_require("full/path/of/es_module/in/sys_module/table"); myModule.methodA(); myModule.propertyB; ``` -------------------------------- ### Discover Installed Telecom Scopes Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-telecom-tmf/references/tmf-apis.md Query the sys_db_object table to identify installed telecom-related scopes, such as those starting with sn_ind_tmt_ or sn_ind_tsm_. ```json {"method":"GET","endpoint":"api/now/table/sys_db_object?sysparm_query=nameSTARTSWITHsn_ind_&sysparm_fields=name,label,sys_scope&sysparm_limit=200"} ``` -------------------------------- ### Initialize a project Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/cli-commands.md Scaffold a new project or convert an existing application into a Fluent source-code project. ```bash now-sdk init ``` ```bash now-sdk init --from ``` -------------------------------- ### Create REST API Module with GET Route Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-docs/references/restapi-sample.md Defines a REST API module with a single GET route using the RestApi fluent interface. The 'process' function from an external file is used as the script handler. ```typescript import { RestApi } from '@servicenow/sdk/core' import { process } from '../server/rest-api-handler' /** * This is a simple example of a REST API build using fluent that has 4 routes (GET, POST, PUT, DELETE) * scripts are enclosed in the `script` tag to allow for inline syntax highlighting for server code * /api/restapi-hello */ RestApi({ $id: Now.ID['restapi-modules'], name: 'rest api fluent modules sample', service_id: 'restapi_modules', consumes: 'application/json', routes: [ { $id: Now.ID['restapi-modules-get'], name: 'get', method: 'GET', script: process, }, ], }) ``` -------------------------------- ### Initialize and use the Python API Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/usage.md Demonstrates manual client initialization and common read operations using the Api class. ```python from servicenow_api import Api api = Api( url="https://instance.example.invalid", username="service_account", password="runtime_secret_reference", ) # Reads incidents = api.get_incidents() # list of incident records incident = api.get_incident(incident_id="") # a single incident changes = api.get_change_requests() # change requests ci = api.get_cmdb(cmdb_id="") # CMDB configuration item records = api.get_table(table="incident") # raw Table API read ``` -------------------------------- ### now-sdk init Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/cli-commands.md Scaffolds a new Fluent project or converts an existing application on an instance into a source-code project. ```APIDOC ## now-sdk init ### Description Initializes a new project or converts an existing scoped application into a Fluent project. ### Usage - `now-sdk init` (Interactive mode) - `now-sdk init --from ` (Convert existing app) ``` -------------------------------- ### Instantiate and Call SampleClass Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-docs/references/sys_module-sample.md This snippet shows how to instantiate a class exposed via a script include and call its methods. ```javascript var sample = new SampleClass(); sample.getTestOne(); ``` -------------------------------- ### Initialize client from environment variables Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/usage.md Uses get_client to automatically configure the API client from environment variables or .env files. ```python from servicenow_api.auth import get_client api = get_client() # reads SERVICENOW_* from the environment / .env, # auto-detecting OIDC delegation or basic auth ``` -------------------------------- ### Manage authentication profiles Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/cli-commands.md Add, list, or select instance credentials. Use --password-stdin for non-interactive CI environments. ```bash now-sdk auth --add --type basic --alias --username ``` ```bash echo "$SN_PASSWORD" | now-sdk auth --add --type basic --alias --username --password-stdin ``` ```bash now-sdk auth --list ``` ```bash now-sdk auth --use ``` -------------------------------- ### Get application metadata Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-platform-utilities/WORKFLOW.md Retrieves metadata for a specific application using the get_application action. ```json {"sys_id":""} ``` -------------------------------- ### Get Attachments for ServiceNow Record Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-docs/references/flow-sample.md Retrieves all attachments associated with a specific ServiceNow record. ```javascript const attachments = wfa.action( action.core.getAttachmentsOnRecord, { $id: Now.ID['get_article_attachments'] }, { source_record: wfa.dataPill(article.Record.sys_id, 'reference') } ) ``` -------------------------------- ### Get record by sys_id Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-table-api/SKILL.md Fetches a single record from a table using its unique system identifier. ```json {"table":"cmdb_ci","table_record_sys_id":"","sysparm_display_value":"all"} ``` -------------------------------- ### Run the documentation build script Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-docs-builder/WORKFLOW.md Execute the build script from the scripts directory to update the documentation skill at the specified target path. ```bash # From the skill's scripts directory python build_docs.py --target /path/to/universal-skills/servicenow-sdk ``` -------------------------------- ### Fetch dependencies Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/cli-commands.md Generate type definitions for platform tables based on the configuration in now.config.json. ```bash now-sdk dependencies ``` -------------------------------- ### Run via Docker Source: https://github.com/knuckles-team/servicenow-api/blob/main/docs/installation.md Pulling and executing the prebuilt container image with required environment variables. ```bash docker pull example/servicenow-api@sha256: docker run --rm -i \ -e SERVICENOW_INSTANCE=https://your-instance.service-now.com \ -e SERVICENOW_USERNAME=admin \ -e SERVICENOW_PASSWORD=your_password \ example/servicenow-api@sha256: # stdio transport (default) ``` -------------------------------- ### Get one CI with attributes and relations Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-cmdb/WORKFLOW.md Use get_cmdb_instance to retrieve a specific CI including its relationship graph. ```json {"class_name":"cmdb_ci_linux_server","sys_id":""} ``` -------------------------------- ### Build Fluent source Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/build-transform.md Compiles Fluent source files into a deployable package and validates syntax. ```bash now-sdk build ``` -------------------------------- ### Discover VR Tables via Query Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-secops/references/vr-tables.md Query the sys_db_object table to find all tables starting with the sn_vul_ prefix. ```text sysparm_query":"nameSTARTSWITHsn_vul_" ``` -------------------------------- ### Discover TMF API Paths Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-telecom-tmf/SKILL.md Retrieves installed TMF API scoped-app tables to determine the correct endpoint paths. ```APIDOC ## GET api/now/table/sys_db_object ### Description Queries the system for installed TMF API scoped-app tables to confirm the correct path prefix. ### Method GET ### Endpoint api/now/table/sys_db_object ### Parameters #### Query Parameters - **sysparm_query** (string) - Required - Filter for tables starting with 'sn_ind_' - **sysparm_fields** (string) - Required - Fields to return (name, label, sys_scope) - **sysparm_limit** (integer) - Optional - Limit the number of results ``` -------------------------------- ### servicenow_cicd(action, params_json) Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/deploy-and-install.md Executes remote orchestration tasks such as installing, publishing, or rolling back applications on remote instances. ```APIDOC ## servicenow_cicd(action, params_json) ### Description Orchestrates application lifecycle actions on remote instances using a source-control or application repository. ### Parameters - **action** (string) - Required - The operation to perform (e.g., app_repo_install, app_repo_publish, app_repo_rollback, batch_install, progress, full_scan, point_scan, suite_scan). - **params_json** (string) - Required - A JSON-formatted string containing the parameters specific to the chosen action. ### Request Example servicenow_cicd(action="app_repo_install", params_json='{"name":"my_app","sys_id":"12345","version":"1.0.0"}') ### Notes Calls are asynchronous. Capture the returned progress_id and poll the 'progress' action until completion. ``` -------------------------------- ### Standard project layout Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/project-init.md The recommended directory structure for a ServiceNow SDK project. ```text my-app/ ├── package.json # npm/pnpm project + now-sdk scripts + @servicenow/sdk dep ├── now.config.json # SDK config: scope, name, generated-dir, dependencies ├── src/ │ ├── fluent/ # your Fluent metadata (*.now.ts) — the source of truth │ │ ├── index.now.ts # entry point │ │ └── generated/ # `dependencies`/`transform` output (auto-imported) │ └── server/ # server-side JS/TS referenced via Now.include(...) / imports └── .now-sdk/ # local CLI state (gitignored) ``` -------------------------------- ### Get incident by sys_id Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-incident-management/WORKFLOW.md Retrieves a single incident record using its unique sys_id, requesting both raw and display values. ```json {"sys_id":"","sysparm_display_value":"all"} ``` -------------------------------- ### Import a repository via ServiceNow Studio Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-studio-gitlab-app/references/path-a-native-source-control.md Use the import_repository action to initialize a new scoped app from a GitLab repository. ```json {"repo_url":"https://gitlab.example/group/app-repo.git","branch_name":"main","credential_sys_id":""} ``` -------------------------------- ### Define a record trigger Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-workflow-studio/references/triggers.md Example of configuring a record creation trigger for the incident table with a specific condition and background execution. ```typescript wfa.trigger( trigger.record.created, { $id: Now.ID['trg'] }, { table: 'incident', condition: 'origin=NULL', run_flow_in: 'background' }, ) ``` -------------------------------- ### Run the Agent CLI Source: https://github.com/knuckles-team/servicenow-api/blob/main/README.md Set the required environment variables and execute the agent server command. ```bash # Set credentials export SERVICENOW_INSTANCE="your_value" export SERVICENOW_USERNAME="your_value" export SERVICENOW_CLIENT_ID="your_value" export SERVICENOW_TLS_PROFILE=system export DEBUG="your_value" export PYTHONUNBUFFERED="your_value" export SERVICENOW_PASSWORD="your_value" export SERVICENOW_CLIENT_SECRET="your_value" # Run the agent server servicenow-agent --provider openai --model-id gpt-4o ``` -------------------------------- ### now-sdk build Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/cli-commands.md Compiles Fluent source code into a deployable package. ```APIDOC ## now-sdk build ### Description Compiles `src/fluent/**` into a deployable package and validates syntax. ``` -------------------------------- ### Raw TMF Endpoint Request Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-telecom-tmf/WORKFLOW.md Example of calling a raw TMF endpoint using the custom API request method. ```json {"method":"GET","endpoint":"api/sn_ind_tmt_orchestration/tmf-api/productOrderingManagement/v4/productOrder?limit=10"} ``` -------------------------------- ### Manage CI lifecycle status Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-cmdb/WORKFLOW.md Perform a two-step process to get and then update a CI's lifecycle status using servicenow_cilifecycle. ```json {"sys_id":""} ``` ```json {"sys_id":"","status":"in_use"} ``` -------------------------------- ### Scan for software EOL Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-trm/WORKFLOW.md Query the software product model table to identify items reaching end-of-life by the start of the next year. ```json {"table":"cmdb_software_product_model","sysparm_query":"end_of_lifeISNOTEMPTY^end_of_life<=javascript:gs.beginningOfNextYear()^ORDERBYend_of_life","sysparm_fields":"name,manufacturer,end_of_life,end_of_support","sysparm_limit":100,"sysparm_display_value":"true"} ``` -------------------------------- ### CLI utility commands Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-lifecycle/references/cli-commands.md Commands for checking version, upgrading the SDK, or viewing help documentation. ```bash now-sdk version ``` ```bash now-sdk upgrade ``` ```bash now-sdk help [command] ``` -------------------------------- ### Create Computer CI Records Source: https://github.com/knuckles-team/servicenow-api/blob/main/servicenow_api/skills/servicenow-sdk-docs/references/record-sample.md This example generates two new computer records in the cmdb_ci_computer table. Note the distinct $id for each record. ```typescript import { Record } from '@servicenow/sdk/core' //This example generates a record in the incident table Record({ $id: Now.ID['cmdb-ci-computer-1'], table: 'cmdb_ci_computer', data: { asset_tag: 'ASSET001', assigned: '2024-04-21 07:00:00', category: 'Hardware', company: '31bea3d53790200044e0bfc8bcbe5dec', cost_center: '7fb1cc99c0a80a6d30c04574d14c0acf', cpu_manufacturer: '7aad6d00c611228400f00e0f80b67d2d', cpu_speed: 798, first_discovered: '2006-09-12 20:55:20', install_date: '2023-10-29 08:00:00', model_id: 'a9a2d0c3c6112276010db16c5ddd3461', name: 'Computer 1', os: 'Windows XP Professional', os_service_pack: 'Service Pack 3', os_version: '5.1', po_number: 'PO27711', ram: '1543', serial_number: 'L3BB911', }, }) Record({ $id: Now.ID['cmdb-ci-computer-2'], table: 'cmdb_ci_computer', data: { asset_tag: 'ASSET002', assigned: '2024-04-21 07:30:00', category: 'Hardware', company: '31bea3d53790200044e0bfc8bcbe5dec', cost_center: '7fb1cc99c0a80a6d30c04574d14c0acf', cpu_manufacturer: '7aad6d00c611228400f00e0f80b67d2d', cpu_speed: 798, first_discovered: '2006-09-12 20:55:20', install_date: '2023-10-29 08:00:00', model_id: 'a9a2d0c3c6112276010db16c5ddd3461', name: 'Computer 1', os: 'Windows XP Professional', os_service_pack: 'Service Pack 3', os_version: '5.1', po_number: 'PO27711', ram: '1543', serial_number: 'L3BB911', }, }) ```