Class of 2026

FINAL YEAR.
LOST?

Placements feel uncertain.
Career path unclear.
You need direction.

We'll help you figure it out.
Let's connect.

Real guidance. Real results.

Skip to main content

ServiceNow Scripting Scenarios

This document outlines various scripting scenarios in ServiceNow, categorized by topic.

Basics

  1. Generate Unique Identifier: Create a script to generate a unique identifier for a custom record.
  2. Update User Department: Write a script to update a user's department based on their job title.
  3. Delete Old Records: Create a script to delete all records older than a specified date.
  4. High-Priority Incident Notification: Write a script to send a notification when a high-priority incident is created.
  5. Task Assignment: Develop a script to assign a task to a specific group based on the task's category.
  6. Form Input Validation: Create a script to validate user input on a custom form.
  7. Update User Location: Write a script to update the location of all users in a specific department.
  8. Close Incidents on Deactivation: Develop a script to close all open incidents for a user when their account is deactivated.
  9. Export Data to Excel: Write a script to export specific data from ServiceNow to an Excel file.
  10. Calculate Total Incident Cost: Create a script to calculate the total cost of all open incidents.

Advanced GlideRecord Queries

  1. Incidents for CI: Write a GlideRecord query to find all incidents related to a specific CI.
  2. Active Users in Domain: Create a GlideRecord query to retrieve all active users in a specific domain.
  3. Open Incidents for Group: Develop a GlideRecord query to find all open incidents assigned to a specific group.
  4. Problems for Incident: Write a GlideRecord query to find all problems related to a specific incident.
  5. Incidents by Priority and Group: Create a GlideRecord query to retrieve all incidents with a specific priority and assignment group.
  6. Changes for Maintenance Window: Develop a GlideRecord query to find all changes scheduled for a specific maintenance window.
  7. Open Tasks by Group and Due Date: Write a GlideRecord query to find all open tasks with a specific assignment group and due date.
  8. Knowledge Articles by Category: Create a GlideRecord query to retrieve all knowledge articles related to a specific category.
  9. Catalog Items by Category and Price: Develop a GlideRecord query to find all service catalog items in a specific category with a specific price.
  10. Users by Department and Job Title: Write a GlideRecord query to find all users in a specific department with a specific job title.

UI Policies and Client Scripts

  1. Short Description Format: Create a UI policy to enforce a specific format for the 'Short Description' field on the Incident form.
  2. Client-Side Form Validation: Write a client script to validate user input on a custom form.
  3. Hide/Disable Fields by Role: Develop a UI policy to hide or disable specific fields on a form based on user roles.
  4. Auto-Populate Fields: Create a client script to auto-populate fields on a form based on user input.
  5. Conditional Mandatory Field: Write a UI policy to make a field mandatory based on the value of another field.
  6. Auto-Complete Field: Develop a client script to provide an auto-complete feature for a specific field.
  7. Date/Time Format: Create a UI policy to enforce a specific format for date and time fields.
  8. Unsaved Changes Warning: Write a client script to display a warning message when a user tries to leave a form without saving changes.
  9. Show/Hide Sections: Develop a UI policy to hide or show specific sections on a form based on user input.
  10. Update Field Based on Others: Create a client script to update a field's value on a form based on the values of other fields.

Script Includes and Server-Side Scripting

  1. Task Due Date Calculation: Write a script include to calculate the due date for a task based on its priority.
  2. Phone Number Validation/Formatting: Create a script include to validate and format phone numbers.
  3. Manager Approval Request: Develop a script include to send an approval request to a user's manager.
  4. Custom Incident Number: Write a script include to determine the next available incident number based on a custom format.
  5. Data Encryption/Decryption: Create a script include to encrypt and decrypt sensitive data.
  6. Unique Record Code: Develop a script include to generate a unique code for a specific record.
  7. Update Related Tasks on Incident Closure: Write a script include to update the status of related tasks when an incident is closed.
  8. Service Catalog Request Cost: Create a script include to calculate the total cost of all items in a service catalog request.
  9. Group Users and Manager Info: Develop a script include to retrieve all users in a specific group and their manager's information.
  10. Email Notification with Incident Details: Write a script include to send an email notification with incident details to a specific user.

Scheduled Jobs and Background Scripts

  1. Old Record Cleanup: Write a scheduled job script to clean up old records from a specific table.
  2. Daily Open Incident Report: Create a scheduled job script to send a daily report of open incidents to a specific user.
  3. Update Tasks on Problem Closure: Develop a background script to update the status of related tasks when a problem is closed.
  4. Expired License Check: Write a scheduled job script to check for expired licenses and send notifications to the respective users.
  5. External User Data Sync: Create a background script to sync user data from an external system into ServiceNow.
  6. Incident Assignment by Category: Develop a scheduled job script to update the assignment group of incidents based on the category.
  7. Average Incident Resolution Time: Write a background script to calculate the average resolution time for incidents and update a report.
  8. Upcoming Maintenance Notifications: Create a scheduled job script to send notifications for upcoming maintenance tasks.
  9. Inactive User Deactivation: Develop a background script to check for inactive users and deactivate their accounts.
  10. Data Export to External System: Write a scheduled job script to export specific data from ServiceNow to an external system.

REST APIs and Scripted REST APIs

  1. Create User via API: Create a Scripted REST API to allow an external system to create a new user record in ServiceNow.
  2. Retrieve External Data: Write a script to call an external REST API and retrieve data to update ServiceNow records.
  3. Retrieve Data for External System: Develop a Scripted REST API to retrieve specific data from ServiceNow for an external system.
  4. Post Data to External System: Create a script to call an external REST API and post data from ServiceNow to the external system.
  5. Update Record via API: Write a Scripted REST API to update specific fields of a ServiceNow record from an external system.
  6. Custom Action via API: Develop a script to call a Scripted REST API to perform a custom action in ServiceNow from an external system.
  7. Incidents for User and Manager: Create a Scripted REST API to retrieve all incidents for a specific user and their manager's information.
  8. API Error Handling: Write a script to handle errors and exceptions when calling an external REST API.
  9. Record Count via API: Develop a Scripted REST API to return the total count of records in a specific table for an external system.
  10. OAuth 2.0 Authentication: Create a script to authenticate and call an external REST API using OAuth 2.0.

REST Integrations

  1. Monitoring Tool Integration: Integrate ServiceNow with a monitoring tool to automatically create incidents based on alerts.
  2. User/Group Sync via REST: Write a script to sync users and groups from an external system to ServiceNow using REST APIs.
  3. Asset Sync via REST: Develop a custom REST integration to sync assets from ServiceNow to an external system.
  4. Chatbot Integration: Create a script to integrate ServiceNow with a chatbot application to manage incident tickets.
  5. Change Request Sync: Write a REST integration to sync change requests between ServiceNow and an external project management system.
  6. Release/Deployment Sync: Develop a custom integration to sync release and deployment information between ServiceNow and a CI/CD tool.
  7. Social Media Integration: Integrate ServiceNow with a social media platform to manage social media posts and comments as tasks.
  8. Problem Record Sync: Create a script to sync problem records between ServiceNow and an external knowledge management system.
  9. Customer Request Tracking: Write a REST integration to manage and track customer requests from an external CRM system.
  10. HR Case Sync: Develop a custom REST integration to sync HR cases between ServiceNow and an external HR management system.