Clear Assignee When Assignment Group Changes
Clear the incident assignee when the assignment group changes on a classic form, so an assignee from the previous group is not carried over accidentally.
View script ↗The script library
ServiceNow code examples to read, adapt, and test in your development instance.

74 scripts
Clear the incident assignee when the assignment group changes on a classic form, so an assignee from the previous group is not carried over accidentally.
View script ↗Prevent incident form submission when Short description is empty or contains only whitespace, without changing the text entered by the user.
View script ↗Automatically populate fields when a reference field changes (e.g., populate caller's phone and email when caller is selected).
View script ↗Make fields mandatory based on the value of another field (e.g., require close notes only when state is Resolved).
View script ↗Show or hide fields based on another field's value (e.g., show "Other reason" field only when user selects "Other" from dropdown).
View script ↗Filter options in a reference field based on another field's value (e.g., show only assignment groups for the selected category).
View script ↗Validate form data and prevent submission if conditions aren't met (e.g., prevent closing ticket without resolution notes).
View script ↗Call server-side Script Include from client-side to fetch data or perform operations without page refresh.
View script ↗Validate field input in real-time and provide immediate feedback to users (e.g., check format, valid values, etc.).
View script ↗Show a confirmation dialog before saving the form when certain conditions are met (e.g., warn user about critical changes).
View script ↗Automatically populate form fields with the current logged-in user's information (e.g., pre-fill requester details).
View script ↗Automatically calculate field values based on other fields (e.g., calculate total cost, days between dates, percentage).
View script ↗Show or hide sections or specific fields based on the current user's roles, useful for restricting sensitive information access.
View script ↗Implement a debounced search to avoid excessive server calls when users type in a search field, improving performance.
View script ↗Validate combinations of multiple fields together, such as ensuring end date is after start date or validating business logic across fields.
View script ↗Periodically save form data automatically to prevent data loss if browser crashes or session expires.
View script ↗Show contextual help text or tooltips for specific fields to guide users, with ability to toggle help on/off.
View script ↗Disable the submit button after first click to prevent duplicate record creation from double-clicks or multiple submissions.
View script ↗Validate date fields against each other with custom business rules like working days, blackout periods, and lead times.
View script ↗Prevent a change request from saving when its planned end is before its planned start, using server-side validation rather than a form-only check.
View script ↗Automatically assign tickets to the appropriate assignment group based on category.
View script ↗Send customized email notifications when specific conditions are met.
View script ↗Automatically populate fields with default values or calculated values when a record is created.
View script ↗Check for existing records and prevent duplicates based on specific field combinations.
View script ↗Automatically update related records when the parent record status changes (e.g., resolve all child tasks when parent is resolved).
View script ↗Automatically create related records when certain conditions are met (e.g., create change request when major incident is detected).
View script ↗Automatically calculate SLA due dates based on priority, business hours, and update SLA status.
View script ↗Automatically create approval records and request approvals when certain conditions are met (e.g., high-cost purchases, major changes).
View script ↗Create detailed audit trail records when sensitive fields are modified, maintaining compliance and tracking changes.
View script ↗Send data to external systems via REST API webhooks when records are created or updated (e.g., Slack, Teams, third-party systems).
View script ↗Limit which records users can see based on custom criteria like location, department, or assignment group membership.
View script ↗Calculate and display values on forms without modifying the database, useful for showing metrics, totals, or derived information.
View script ↗Send notifications asynchronously based on complex business logic, preventing delays in record save operations.
View script ↗Automatically update related child records when parent record changes, maintaining data consistency across relationships.
View script ↗Generate custom record numbers with prefixes based on category, type, or other fields (e.g., HW0001, SW0002, NET0003).
View script ↗Reject new or changed incident callers when the user is inactive or missing, while allowing unrelated updates to incidents with historical inactive callers.
View script ↗Return the attachment count and total file size in bytes for one record using metadata only, without reading file contents or changing records.
View script ↗Provide server-side functions that can be called from Client Scripts via GlideAjax.
View script ↗Reusable functions for date and time calculations and formatting.
View script ↗Reusable functions for user and group operations.
View script ↗Reusable functions for string operations and text processing.
View script ↗Reusable functions for validating data and enforcing business rules.
View script ↗Simplified and safe GlideRecord operations with error handling.
View script ↗Reusable functions for making REST API calls to external systems with error handling and authentication.
View script ↗Reusable functions for working with Configuration Items (CIs) in the CMDB.
View script ↗A comprehensive Script Include demonstrating multiple client-callable functions in a single utility class.
View script ↗Reusable functions for common date and time calculations, business days, and formatting.
View script ↗Reusable functions for common string operations, formatting, and transformations.
View script ↗Standardized functions for formatting and handling REST API responses with consistent error handling.
View script ↗Efficient GlideRecord query patterns with built-in best practices, error handling, and common operations.
View script ↗Add a list button to update multiple selected records at once with custom logic.
View script ↗Add a form button to create a copy of the current record with all field values.
View script ↗Add a form button to export the current record to a PDF document.
View script ↗Add a form button to trigger approval workflow with validation.
View script ↗Add a form button to open a popup showing related records from another table.
View script ↗Update multiple selected list records with custom field values, useful for mass updates.
View script ↗Export selected list records to CSV file with custom field selection.
View script ↗Deep copy a record including related child records like tasks, attachments, and notes.
View script ↗Trigger a custom approval workflow with validation and user selection of approvers.
View script ↗One-click UI Action to escalate a ticket's priority with mandatory escalation reason, automatic notification to assignment group supervisor, and audit trail entry. Configurable escalation matrix maps current priority to target priority.
View script ↗Reopen incidents that have been resolved but not closed within a configurable number of days, with notification to assignees and optional audit logging.
View script ↗List active user accounts whose local locked_out flag is set, for manual access troubleshooting without unlocking accounts or changing security settings.
View script ↗List up to 100 requested approval records created more than seven days ago for manual follow-up, without changing approvals or sending notifications.
View script ↗Find up to 100 active incidents assigned to inactive users so administrators can review stale ownership. Reports only; no records are changed.
View script ↗Report active incidents with no assignee, grouped by assignment group, without updating any records. Includes incidents with no assignment group.
View script ↗Find up to 100 active tasks whose populated due date is before the execution time, oldest first. Read-only; no records are changed.
View script ↗Find active incidents routed to inactive assignment groups so administrators can review ownership. Read-only: no incident or group records are changed.
View script ↗Find login names shared by multiple active user records for identity-data review, without changing accounts.
View script ↗Find active incidents with an empty assignment group for manual queue triage, without assigning records or sending notifications.
View script ↗Find up to 100 active incidents with an empty caller reference for manual data-quality review. Read-only; no records or notifications are changed.
View script ↗Find up to 100 active incidents whose caller user record is inactive for manual review. Read-only; no records or notifications are changed.
View script ↗Find active groups whose referenced manager is inactive, for manual ownership review without changing group membership or manager assignments.
View script ↗Identify active groups with an empty manager reference for manual ownership review, without modifying group records or membership.
View script ↗Identify active user accounts with an empty department reference for manual data-quality review, without changing user records.
View script ↗