Adding warning and failure messages to validation results
You use the CdmPolicyUtil script include to add warning and failure messages to validation results in the CDM Policy Validation Results table. CDM expects validation warnings and failures to contain a node path, a snapshot ID, and a reference to the impacted node.
Important: DevOps Config is now deprecated and no longer supported or available for new activation.
CdmPolicyUtil
CdmPolicyUtilis a public script include.- Because
CdmPolicyUtilis a global script include, you do not need to invoke it like a new CdmPolicyUtil(). - You can invoke
CdmPolicyUtilin all scopes, but the expected invocation scope is PaCE (specifically, during the execution of PaCE policies). - The proper call is
CdmPolicyUtil.methodName(parameters).
Note: If you add warning and failure messages to validation results manually instead of using CdmPolicyUtil, the snapshot validation status will show Execution Error.
Methods
-
addFailure
Adds a failure message. The message appears on the Validation results tab for the snapshot.
Parameters:
- Output: Policy decision for the subject snapshot (primarySnapshotId).
- cdmNode: Node (sn_cdm_node) that caused the failure.
- name: Name of the failure.
- description: Description of the failure.
-
addWarning
Adds a policy warning message. The message appears on the Validation results tab for the snapshot.
Parameters:
- Output: Policy decision for the subject snapshot (primarySnapshotId).
- cdmNode: Node (sn_cdm_node) that caused the warning.
- name: Name of the warning.
- description: Description of the warning.
-
getLastCreatedSnapshotIds
Returns the latest created and published snapshot IDs for the supplied additionalDeployables. If no published snapshot is available for a particular deployable, adds a debug message.
Parameter:
additionalDeployables – can be passed directly as it comes to the policy.
-
getLastPublishedSnapshotIds
Retrieves the latest and published snapshot IDs for the supplied additionalDeployables. If no published snapshot is available for a particular deployable, adds a debug message.
Parameter:
additionalDeployables - can be passed directly as it comes to the policy.
---
title: Adding warning and failure messages to validation results
description: You use the CdmPolicyUtil script include to add warning and failure messages to validation results in the CDM Policy Validation Results table. CDM expects validation warnings and failures to contain a node path, a snapshot ID, and a reference to the impacted node.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/australia/it-service-management/devops-family/cdm-about-cdmpolicyutil.html
release: australia
product: DevOps \(Family\)
classification: devops-family
topic_type: reference
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Validating and correcting configuration data, Using DevOps Config, DevOps Config, IT Service Management]
---
# Adding warning and failure messages to validation results
You use the `CdmPolicyUtil` script include to add warning and failure messages to validation results in the CDM Policy Validation Results table. CDM expects validation warnings and failures to contain a node path, a snapshot ID, and a reference to the impacted node.
**Important:** DevOps Config is now deprecated and no longer supported or available for new activation.
## CdmPolicyUtil
- `CdmPolicyUtil` is a public script include.
- Because `CdmPolicyUtil` is a global script include, you do not need to invoke it like a new CdmPolicyUtil\(\).
- You can invoke `CdmPolicyUtil` in all scopes, but the expected invocation scope is PaCE \(specifically, during the execution of PaCE policies\).
- The proper call is `CdmPolicyUtil.methodName(parameters)`.
**Note:** If you add warning and failure messages to validation results manually instead of using CdmPolicyUtil, the snapshot validation status will show Execution Error.
## Methods
- **addFailure**
Adds a failure message. The message appears on the **Validation results** tab for the snapshot.
Parameters:
- **Output**: Policy decision for the subject snapshot \(**primarySnapshotId**\).
- **cdmNode**: Node \(**sn\_cdm\_node**\) that caused the failure.
- **name**: Name of the failure.
- **description**: Description of the failure.
- **addWarning**
Adds a policy warning message. The message appears on the **Validation results** tab for the snapshot.
Parameters:
- **Output**: Policy decision for the subject snapshot \(**primarySnapshotId**\).
- **cdmNode**: Node \(**sn\_cdm\_node**\) that caused the warning.
- **name**: Name of the warning.
- **description**: Description of the warning.
- **getLastCreatedSnapshotIds**
Returns the latest created and published snapshot IDs for the supplied **additionalDeployables**. If no published snapshot is available for a particular deployable, adds a debug message.
Parameter:
**additionalDeployables** – can be passed directly as it comes to the policy.
- **getLastPublishedSnapshotIds**
Retrieves the latest and published snapshot IDs for the supplied **additionalDeployables**. If no published snapshot is available for a particular deployable, adds a debug message.
Parameter:
**additionalDeployables** - can be passed directly as it comes to the policy.
| title | Adding warning and failure messages to validation results |
| description | You use the CdmPolicyUtil script include to add warning and failure messages to validation results in the CDM Policy Validation Results table. CDM expects validation warnings and failures to contain a node path, a snapshot ID, and a reference to the impacted node. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/australia/it-service-management/devops-family/cdm-about-cdmpolicyutil.html |
| release | australia |
| product | DevOps \(Family\) |
| classification | devops-family |
| topic_type | reference |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Validating and correcting configuration dataUsing DevOps ConfigDevOps ConfigIT Service Management |