You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📘 README — Incident State Validation (Client Script)
2
+
Overview
3
+
4
+
This Client Script enforces the correct ITIL incident lifecycle by preventing users from directly closing an incident without first transitioning it through the Resolved state.
5
+
If a user attempts to move the state directly to Closed Complete, the system reverts the change and displays a notification.
6
+
7
+
What This Code Does
8
+
Monitors changes to the state field on Incident form
9
+
Checks if new selection is trying to skip the Resolved step
10
+
Reverts state to its previous value when the rule is violated
11
+
Alerts the user with a clear and guided message
12
+
Refreshes the form to maintain data consistency
13
+
Usage Instructions
14
+
15
+
Create a Client Script on the Incident table
16
+
Type: onChange
17
+
Field Name: state
18
+
Paste the script under the script section
19
+
Test by trying to directly move an Incident to Closed Complete
20
+
S
21
+
cript Requirements
22
+
State values must be configured as:
23
+
6 → Resolved
24
+
7 → Closed Complete
25
+
26
+
Script runs only on Incident records
27
+
Must be active in applicable ITIL views
28
+
Notes for Developers
29
+
This code supports clean transition handling for ITSM workflows
30
+
Helps enforce process compliance without server-side overhead
31
+
Recommended for environments requiring strict closure governance
0 commit comments