Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
In IT Service Management (ITSM), certain field combinations don’t make sense logically — for instance:
A High Priority incident should not have a Low Impact.
A Change Request marked as Emergency should not have Approval Type = Standard.
ServiceNow’s out-of-the-box (OOB) configurations can validate simple field requirements, but cannot enforce relational validation between two or more fields at the server-side level.
This custom Business Rule ensures data integrity by preventing users from saving or updating records when invalid field combinations occur.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(function executeRule(current, previous /*null when async*/) {

// Example: Prevent record submission if Impact = Low and Priority = High
if (current.impact == 3 && current.priority == 1) { // 3 = Low, 1 = High
gs.addErrorMessage("Invalid combination: 'High' Priority cannot be set with 'Low' Impact.");
current.setAbortAction(true); // Prevents insert/update
}

})(current, previous);
Loading