File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Server-Side Components/Business Rules/Auto close incident if all related changes are closed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ Business Rule: Auto-Close Incident When All Related Changes Are Closed
2+ Table : change_request
3+ When to Run: After update
4+ Condition: state changes to Closed (or your equivalent "Closed" state number, e.g. state == 3)
5+
6+ Detailed Working
7+ 1 . Trigger Point
8+ This After Business Rule runs after a Change Request record is updated.
9+ Specifically, it checks when the state changes to “Closed”.
10+
11+ 2 . Check for Related Incident
12+ The script retrieves the incident reference field (incident) from the current change request.
13+ If there’s no linked incident, it skips execution.
14+
15+ 3 . Check for Any Remaining Open Change Requests
16+ A new GlideRecord query checks for other Change Requests linked to the same incident where:
17+ If any such records exist, it means not all change requests are closed — so the incident remains open.
18+
19+ 4 . Close the Incident Automatically
20+ If no open Change Requests remain, the script:
21+ Fetches the linked incident.
22+ Sets: state = 7 (Closed)
23+ close_code = Auto Closed
24+ close_notes = Auto closure as all changes are closed.
25+ Updates the record.
You can’t perform that action at this time.
0 commit comments