Skip to content

CMDB: report hardware assets whose CI status does not match the asset-CI mapping - #2676

Open
itam-automation wants to merge 2 commits into
ServiceNowDevProgram:mainfrom
itam-automation:feature/asset-ci-status-drift
Open

itam-automation wants to merge 2 commits into
ServiceNowDevProgram:mainfrom
itam-automation:feature/asset-ci-status-drift

Conversation

@itam-automation

@itam-automation itam-automation commented Nov 11, 2026 •

Copy link
Copy Markdown

PR Description:

A read-only background script that compares the status of each hardware asset with the status of its CI, using the platform's own mapping table alm_asset_ci_state_mapping instead of hard-coded values. It groups all assets in one GlideAggregate query (grouped by ci.install_status), so it stays fast on large tables, and lists every mismatch with a count and sample asset tags.

Asset and CI drift apart in practice, for example when an integration writes the CI status and no mapping row syncs it back, or when imports and fix scripts run with setWorkflow(false). On a PDI (Brazil) with the demo data and 197 test assets of my own, the script found 120 mismatches out of 1091 assets. The output is in the README. It checks install_status only, not Hardware Status.

Pull Request Checklist

Overview

  • I have read and understood the CONTRIBUTING.md guidelines
  • My pull request has a descriptive title that accurately reflects the changes and the description has been filled in above.
  • I've included only files relevant to the changes described in the PR title and description
  • I've created a new branch in my forked repository for this contribution

Code Quality

  • My code is relevant to ServiceNow developers
  • My code snippets expand meaningfully on official ServiceNow documentation (if applicable)
  • I've disclosed use of ES2021 features (if applicable)
  • I've tested my code snippets in a ServiceNow environment (where possible)

Repository Structure Compliance

  • I've placed my code snippet(s) in one of the required top-level categories
  • I've used appropriate sub-categories within the top-level categories
  • Each code snippet has its own folder with a descriptive name

Documentation

  • I've included a README.md file for each code snippet
  • The README.md includes description, usage, prerequisites

Restrictions

  • My PR does not include XML exports of ServiceNow records
  • My PR does not contain sensitive information (passwords, API keys, tokens)
  • My PR does not include changes that fall outside the described scope

Drift does not only come from setWorkflow(false). The example output
included test assets of my own, and Hardware Status is a second pair
of status fields on hardware CIs, not a feature of newer releases.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant