script-include-patterns

Provides ServiceNow Script Include patterns and GlideAjax client-callable examples in ES5 JavaScript.

77|23|Updated Jul 16, 2025
One-click install
npx skills add https://github.com/groeimetai/snow-flow --skill script-include-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: script-include-patterns
Source: https://github.com/groeimetai/snow-flow/tree/main/packages/opencode/src/bundled-skills/script-include-patterns
Command: npx skills add https://github.com/groeimetai/snow-flow --skill script-include-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill provides comprehensive guidance and examples for developing ServiceNow Script Includes, enabling developers to create reusable server-side logic and efficient client-server communication.

Core Features & Use Cases

  • Understand Script Include Types: Learn about Standard, Client Callable, On-Demand, and AbstractAjaxProcessor types.
  • Code Examples: Get practical ES5 JavaScript examples for various Script Include patterns, including inheritance and scoped applications.
  • GlideAjax Integration: See how to implement client-callable Script Includes for seamless client-server interaction.
  • MCP Tool Usage: Discover how to leverage Snow-Flow's MCP tools for creating, finding, editing, and testing Script Includes.
  • Use Case: A developer needs to create a new utility Script Include to calculate incident priority based on impact and urgency, and wants to see best practices and an example of how to implement it.

Quick Start

Use the script-include-patterns skill to create a new client-callable script include named 'IncidentAjax' that can fetch incident details by sys_id.

Frequently Asked Questions about script-include-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a client-callable Script Include in ServiceNow for GlideAjax?

Standard Script Includes run exclusively on the server side for backend logic, while client-callable Script Includes extend AbstractAjaxProcessor to expose methods for GlideAjax client-server communication. Both use ES5 JavaScript for reusable server-side code organization.

What is the best way to structure a reusable ServiceNow Script Include?

The best way to structure a reusable ServiceNow Script Include is to use standard ES5 JavaScript patterns for server-side logic, encapsulating functions within a single class or object. This skill provides examples of standard, on-demand, and inheritance patterns for efficient code reuse.

Can I use ES6 JavaScript features in ServiceNow Script Includes?

ServiceNow Script Includes require ES5 JavaScript syntax. The skill provides examples using ES5 patterns for standard, client-callable, and inheritance structures, ensuring compatibility with the platform's server-side execution engine and scoped applications.

How do I use inheritance patterns in ServiceNow Script Includes?

Inheritance patterns in ServiceNow Script Includes allow you to extend existing classes to share logic across multiple includes. The skill provides ES5 JavaScript examples demonstrating how to create parent and child Script Includes, including patterns for scoped applications.

When should I use an AbstractAjaxProcessor vs a standard Script Include in ServiceNow?

Use AbstractAjaxProcessor when you need client-server communication via GlideAjax, allowing client scripts to call server-side methods. Use a standard Script Include when the logic is only needed server-side for backend processing without direct client interaction.