# Configuration Validation

> Validate ServiceNow configurations including catalog items, workflows, and business rules

- **Type:** Skill
- **Install:** `agentstack add skill-happy-technologies-llc-happy-platform-skills-configuration-validation`
- **Verified:** Pending review
- **Seller:** [Happy-Technologies-LLC](https://agentstack.voostack.com/s/happy-technologies-llc)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [Happy-Technologies-LLC](https://github.com/Happy-Technologies-LLC)
- **Source:** https://github.com/Happy-Technologies-LLC/happy-platform-skills/tree/main/skills/admin/configuration-validation

## Install

```sh
agentstack add skill-happy-technologies-llc-happy-platform-skills-configuration-validation
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Configuration Validation

## Overview

Configuration validation is essential for maintaining quality and preventing errors in ServiceNow deployments. This skill teaches systematic approaches to validate catalog items, workflows, business rules, and other configurations before deployment.

- **What problem does it solve?** Catches configuration errors, missing dependencies, and broken references before they impact users or cause production issues
- **Who should use this skill?** Administrators, developers, and release managers responsible for quality assurance of ServiceNow configurations
- **What are the expected outcomes?** Validated configurations that work correctly, comprehensive error detection, and confidence in deployments

## Prerequisites

- Required ServiceNow roles: `admin` or specific admin roles (`catalog_admin`, `workflow_admin`)
- Read access to configuration tables (sys_script, wf_workflow, sc_cat_item)
- Understanding of ServiceNow configuration types
- Related skills: `admin/schema-discovery` (helpful for understanding structures)

## Procedure

### Step 1: Identify Configuration Type

Determine what type of configuration you need to validate. Each type has different validation requirements.

**Configuration Types and Tables:**

| Configuration Type | Table | Key Validations |
|-------------------|-------|-----------------|
| Catalog Item | sc_cat_item | Variables, workflows, pricing |
| Catalog Variable | item_option_new | Type, reference, choices |
| Workflow | wf_workflow | Activities, transitions, conditions |
| Business Rule | sys_script | Script syntax, conditions, timing |
| UI Policy | sys_ui_policy | Conditions, actions, triggers |
| Client Script | sys_script_client | Script syntax, type, table |
| Script Include | sys_script_include | Client callable, scope |
| ACL | sys_security_acl | Conditions, script, roles |

### Step 2: Catalog Item Validation

Validate catalog items for completeness, proper configuration, and working dependencies.

**If using MCP tools:**
```
Tool: SN-Validate-Configuration
Parameters:
  type: catalog_item
  sys_id: 
  checks:
    - variables
    - workflows
    - pricing
    - approvals
    - fulfillment
```

**If using REST API:**
```bash
# Get catalog item details
GET /api/now/table/sc_cat_item/?sysparm_display_value=all

# Get associated variables
GET /api/now/table/item_option_new?sysparm_query=cat_item=&sysparm_fields=name,type,mandatory,reference,order

# Get associated workflows
GET /api/now/table/wf_workflow?sysparm_query=table=sc_req_item^published=true&sysparm_fields=name,sys_id
```

**Catalog Item Validation Checklist:**

| Check | Description | Severity |
|-------|-------------|----------|
| Active Status | Item is active and visible | Critical |
| Category | Valid category assignment | High |
| Variables | All required variables present | Critical |
| Variable Order | Variables have unique order values | Medium |
| Variable References | Reference fields point to valid tables | Critical |
| Workflow | Fulfillment workflow exists and is published | High |
| Approval Rules | Approval groups/users exist | High |
| Pricing | Price and recurring price are valid | Medium |
| Short Description | Under character limit | Low |
| Icon | Has valid icon or image | Low |

### Step 3: Variable Validation

Validate catalog variables for proper configuration and functionality.

**If using MCP tools:**
```
Tool: SN-Query-Table
Parameters:
  table_name: item_option_new
  query: cat_item=
  fields: name,question_text,type,mandatory,reference,order,variable_set
```

**Variable Type Validation Rules:**

| Type | Required Fields | Common Errors |
|------|-----------------|---------------|
| 1 (Yes/No) | question_text | None |
| 5 (Select Box) | question_text, choices | Missing choices |
| 6 (Single Line) | question_text, max_length | Excessive length |
| 8 (Reference) | question_text, reference | Invalid table reference |
| 9 (Date) | question_text | Date format issues |
| 14 (Macro) | macro | Macro not found |
| 18 (Lookup) | reference, lookup_table | Table mismatch |
| 21 (List Collector) | reference, list_table | Invalid list config |

**Validate Variable Choices:**
```
Tool: SN-Query-Table
Parameters:
  table_name: question_choice
  query: question=
  fields: text,value,order
```

**Decision Points:**
- If type is 5 (Select Box) and no choices exist → Error: Missing choices
- If type is 8 (Reference) and reference table doesn't exist → Error: Invalid reference
- If mandatory=true but default_value is empty → Warning: Required field without default

### Step 4: Workflow Validation

Validate workflows for completeness, proper transitions, and no dead-ends.

**If using MCP tools:**
```
Tool: SN-Validate-Configuration
Parameters:
  type: workflow
  sys_id: 
  checks:
    - activities
    - transitions
    - conditions
    - end_states
```

**If using REST API:**
```bash
# Get workflow details
GET /api/now/table/wf_workflow/?sysparm_display_value=all

# Get workflow activities
GET /api/now/table/wf_activity?sysparm_query=workflow_version.workflow=&sysparm_fields=name,activity_definition,x,y

# Get workflow transitions
GET /api/now/table/wf_transition?sysparm_query=workflow_version.workflow=&sysparm_fields=from,to,condition
```

**Workflow Validation Checklist:**

| Check | Description | Severity |
|-------|-------------|----------|
| Published | Workflow is published and active | Critical |
| Begin Activity | Has exactly one Begin activity | Critical |
| End Activity | Has at least one End activity | Critical |
| Orphan Activities | All activities have incoming transitions | High |
| Dead-End Activities | All activities have outgoing transitions (except End) | High |
| Condition Completeness | All branch conditions are exhaustive | High |
| Activity Scripts | Scripts have valid syntax | Critical |
| Timeout Handlers | Long-running activities have timeouts | Medium |
| Rollback Activities | Approval rejections have proper handling | Medium |

**Detect Orphan Activities:**
```
Tool: SN-Query-Table
Parameters:
  table_name: wf_activity
  query: workflow_version.workflow=^activity_definition.name!=Begin
  fields: sys_id,name

# Then check each activity has incoming transition
Tool: SN-Query-Table
Parameters:
  table_name: wf_transition
  query: to=
  fields: sys_id
```

### Step 5: Business Rule Validation

Validate business rules for proper configuration, syntax, and performance considerations.

**If using MCP tools:**
```
Tool: SN-Validate-Configuration
Parameters:
  type: business_rule
  sys_id: 
  checks:
    - syntax
    - conditions
    - performance
    - scope
```

**If using REST API:**
```bash
# Get business rule details
GET /api/now/table/sys_script/?sysparm_fields=name,when,collection,active,script,filter_condition,order
```

**Business Rule Validation Checklist:**

| Check | Description | Severity |
|-------|-------------|----------|
| Active | Rule is active | Info |
| Table | Valid table reference | Critical |
| When | Appropriate timing (before/after/async) | High |
| Condition | Filter condition is valid | High |
| Script Syntax | No JavaScript errors | Critical |
| GlideRecord in Before | Avoid GlideRecord updates in before rules | High |
| Current.update() | Avoid in before rules (causes recursion) | Critical |
| Changes Check | Uses .changes() for efficiency | Medium |
| Order | Appropriate order value | Medium |
| Scope | Correct application scope | High |

**Common Business Rule Anti-Patterns:**

```javascript
// ANTI-PATTERN 1: current.update() in before rule
// Causes infinite recursion
(function executeRule(current, previous) {
  current.priority = 1;
  current.update(); // BAD! Remove this line
})(current, previous);

// ANTI-PATTERN 2: Unnecessary GlideRecord in before rule
(function executeRule(current, previous) {
  var gr = new GlideRecord('incident');
  gr.get(current.sys_id);
  gr.priority = 1;
  gr.update(); // BAD! Just set current.priority = 1
})(current, previous);

// ANTI-PATTERN 3: No changes() check
(function executeRule(current, previous) {
  // Runs on every update even if priority didn't change
  notifyPriorityChange(current.priority);
})(current, previous);

// CORRECT: Check if field changed
(function executeRule(current, previous) {
  if (current.priority.changes()) {
    notifyPriorityChange(current.priority);
  }
})(current, previous);
```

### Step 6: UI Policy Validation

Validate UI policies for proper configuration and action completeness.

**If using MCP tools:**
```
Tool: SN-Query-Table
Parameters:
  table_name: sys_ui_policy
  query: sys_id=
  fields: short_description,table,conditions,active,global,inherit
```

**Get UI Policy Actions:**
```
Tool: SN-Query-Table
Parameters:
  table_name: sys_ui_policy_action
  query: ui_policy=
  fields: field,mandatory,visible,disabled
```

**UI Policy Validation Checklist:**

| Check | Description | Severity |
|-------|-------------|----------|
| Active | Policy is active | Info |
| Table | Valid table reference | Critical |
| Conditions | Conditions are valid and testable | High |
| Actions Exist | At least one action defined | High |
| Field References | Action fields exist on table | Critical |
| Reverse Handling | Policy handles both true and false states | Medium |
| Order | No conflicting policies with same fields | Medium |

### Step 7: Script Include Validation

Validate script includes for proper configuration and accessibility.

**If using MCP tools:**
```
Tool: SN-Query-Table
Parameters:
  table_name: sys_script_include
  query: sys_id=
  fields: name,api_name,client_callable,access,active,script
```

**Script Include Validation Checklist:**

| Check | Description | Severity |
|-------|-------------|----------|
| Active | Script include is active | Info |
| Name Convention | Follows naming conventions | Medium |
| API Name | Unique and descriptive | Medium |
| Client Callable | Only if needed (security risk) | High |
| Syntax | Valid JavaScript syntax | Critical |
| Prototype Pattern | Uses proper class pattern | Medium |
| Documentation | Has JSDoc comments | Low |
| Dependencies | Referenced script includes exist | High |

### Step 8: ACL Validation

Validate Access Control Lists for proper security configuration.

**If using MCP tools:**
```
Tool: SN-Query-Table
Parameters:
  table_name: sys_security_acl
  query: name=incident
  fields: name,operation,type,active,condition,script,role
```

**ACL Validation Checklist:**

| Check | Description | Severity |
|-------|-------------|----------|
| Active | ACL is active | Info |
| Operation | Valid operation type | Critical |
| Roles | At least one role or condition | Critical |
| Condition | Valid condition expression | High |
| Script | Valid script if used | High |
| Coverage | All operations covered | Medium |
| Inheritance | Proper use of * ACLs | Medium |

### Step 9: Generate Validation Report

Compile all validation results into a comprehensive report.

**Validation Report Template:**

```markdown
# Configuration Validation Report

## Summary
- Configuration: [Name]
- Type: [Catalog Item / Workflow / Business Rule]
- Date: [Date]
- Validator: [Name]

## Overall Status: [PASS / FAIL / WARNING]

## Detailed Findings

### Critical Issues (Must Fix)
1. [Issue description and remediation]
2. [Issue description and remediation]

### High Priority Issues (Should Fix)
1. [Issue description and remediation]

### Medium Priority Issues (Consider Fixing)
1. [Issue description and remediation]

### Low Priority Issues (Nice to Have)
1. [Issue description and remediation]

## Validation Details

### Component 1: [Name]
- Status: [PASS/FAIL]
- Checks Performed: [List]
- Issues Found: [List]

### Component 2: [Name]
- Status: [PASS/FAIL]
- Checks Performed: [List]
- Issues Found: [List]

## Recommendations
1. [Recommendation]
2. [Recommendation]

## Sign-off
- [ ] All critical issues resolved
- [ ] All high priority issues resolved or documented
- [ ] Configuration approved for deployment
```

## Tool Usage

### MCP Tools (Claude Code/Desktop)

| Tool | Purpose | When to Use |
|------|---------|-------------|
| `SN-Validate-Configuration` | Comprehensive validation | Primary validation tool |
| `SN-Query-Table` | Query configuration tables | Detailed inspections |
| `SN-Get-Table-Schema` | Understand table structure | Validate field references |

### REST API (ChatGPT/Other)

| Endpoint | Method | Purpose |
|----------|--------|---------|
| `/api/now/table/sc_cat_item` | GET | Catalog item validation |
| `/api/now/table/item_option_new` | GET | Variable validation |
| `/api/now/table/wf_workflow` | GET | Workflow validation |
| `/api/now/table/sys_script` | GET | Business rule validation |
| `/api/now/table/sys_ui_policy` | GET | UI policy validation |
| `/api/now/table/sys_script_include` | GET | Script include validation |
| `/api/now/table/sys_security_acl` | GET | ACL validation |

### Native Tools (Claude Code)

| Tool | Purpose |
|------|---------|
| `Bash` | Execute validation scripts |
| `Read` | Read validation templates |

## Best Practices

- **Validate Before Promotion:** Always validate configurations before moving between instances
- **Use Automated Validation:** Implement automated validation in CI/CD pipelines
- **Document Exceptions:** Document any validation warnings that are accepted
- **Test with Data:** Validate using realistic test data, not empty records
- **Cross-Reference Dependencies:** Ensure all referenced objects exist in target environment
- **Version Control:** Keep validation reports with update set documentation
- **ITIL Alignment:** Include validation as part of change management process

## Troubleshooting

### Common Issue 1: Validation Returns False Positives

**Symptom:** Validation flags issues that work correctly in practice
**Cause:** Validation logic doesn't account for all valid configurations
**Solution:** Review the specific validation rule and add exception handling

```
# Check if the "error" is actually valid
Tool: SN-Query-Table
Parameters:
  table_name: 
  query: sys_id=
  display_value: all
```

### Common Issue 2: Missing Dependencies in Target Instance

**Symptom:** Configuration works in dev but fails validation in test/prod
**Cause:** Dependencies not included in update set
**Solution:** Query sys_update_xml to find all related records

```
Tool: SN-Query-Table
Parameters:
  table_name: sys_update_xml
  query: update_set=
  fields: type,target_name,name
```

### Common Issue 3: Script Syntax Errors Not Detected

**Symptom:** Invalid JavaScript passes validation but fails at runtime
**Cause:** Basic syntax check doesn't catch all JavaScript errors
**Solution:** Use ServiceNow's syntax checker or background script test

```
Tool: SN-Execute-Background-Script
Parameters:
  script: |
    try {
      eval('');
      gs.info('Syntax check passed');
    } catch(e) {
      gs.error('Syntax error: ' + e.message);
    }
```

### Common Issue 4: Workflow Validation Times Out

**Symptom:** Workflow validation takes too long or fails
**Cause:** Complex workflow with many activities and transitions
**Solution:** Break validation into smaller chunks

```
# Validate activities separately
Tool: SN-Query-Table
Parameters:
  table_name: wf_activity
  query: workflow_version.workflow=
  limit: 50
  offset: 0

# Then transitions
Tool: SN-Query-Table
Parameters:
  table_name: wf_transition
  query: workflow_version.workflow=
  limit: 100
```

## Examples

### Example 1: Complete Catalog Item Validation

```
# Step 1: Get catalog item details
Tool: SN-Query-Table
Parameters:
  table_name: sc_cat_item
  query: sys_id=abc123
  fields: name,short_description,active,category,workflow
  display_value: all

# Result:
name: "New Laptop Request"
active: true
category: "Hardware"
workflow: "Standard Laptop Fulfillment"

# Step 2: Validate variables
Tool: SN-Query-Table
Parameters:
  table_name: item_option_new
  query: cat_item=abc123
  fields: name,question_text,type,mandatory,reference,

…

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Happy-Technologies-LLC](https://github.com/Happy-Technologies-LLC)
- **Source:** [Happy-Technologies-LLC/happy-platform-skills](https://github.com/Happy-Technologies-LLC/happy-platform-skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** yes

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: flagged — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-happy-technologies-llc-happy-platform-skills-configuration-validation
- Seller: https://agentstack.voostack.com/s/happy-technologies-llc
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
