SCRIPTING BR
1. Auto-Create Problem When Incident Reaches Certain Priority
Q: How to automatically create a problem record when incident priority is Critical (1)?
Steps:
-
After Update BR on
incident -
Condition:
priority = 1 and state = In Progress -
Script: above
Tables: incident.priority, problem.incident
2. Link Problem to All Related Incidents
Q: How to link multiple incidents to a problem automatically?
Steps:
-
After Insert BR on
problem -
Condition:
category-specific -
Script: above
Tables: incident.problem_id, problem.sys_id
3. Prevent Closing Problem If Linked Incidents Are Open
Q: How to block problem closure if any linked incident is still active?
Steps:
-
Before Update BR on
problem -
Condition:
state changes to Closed -
Script: above
Tables: incident.problem_id, incident.state, problem.state
4. Auto Update Problem Priority Based on Highest Incident Priority
Q: How to adjust problem priority based on linked incidents?
Steps:
-
Before Update BR on
problem -
Condition:
linked incidents exist -
Script: above
Tables: problem.priority, incident.problem_id, incident.priority
5. Notify Problem Manager When a Critical Incident Links
Q: How to notify problem manager automatically?
Steps:
-
After Update BR on
incident -
Condition:
priority = 1 and linked to problem -
Script: above
Tables: incident.problem_id, incident.priority
6. Auto-Reopen Problem If Linked Incident Reopens
Q: Reopen a problem if any linked incident is reopened
Steps:
-
After Update BR on
incident -
Condition:
state changes to Reopened -
Script: above
Tables: incident.problem_id, problem.state, incident.state
7. Auto Close Problem When All Linked Incidents Are Closed
Q: Automatically close problem if all linked incidents are closed
Steps:
-
Before Update BR on
problem -
Condition:
linked incidents -
Script: above
Tables: problem.state, incident.problem_id, incident.state
8. Auto Assign Problem to Incident Assignment Group
Q: How to assign problem to the same group as the incident?
Steps:
-
Before Insert BR on
problem -
Script: above
Tables: problem.assignment_group, incident.assignment_group
9. Prevent Incident Deletion If Linked to Problem
Q: How to block deletion of incidents linked to a problem?
Steps:
-
Before Delete BR on
incident -
Script: above
Tables: incident.problem_id
10. Auto Add Incident Notes to Problem Work Notes
Q: Propagate work notes from incident to linked problem
Steps:
-
After Update BR on
incident -
Condition:
work_notes changes and linked to problem -
Script: above
Tables: incident.work_notes, problem.work_notes
==================================================================================
11. Auto-Assign Incident to Logged-In User if Assignment Group Empty
Q: How to auto-assign incident to the current user if no group is selected?
Steps:
-
Before Insert BR on
incident -
Condition:
assignment_group is empty -
Script: above
Tables: incident.assignment_group, incident.assigned_to
12. Prevent Low Priority Incidents During Business Hours
Q: How to block incidents with priority 5 from being created during office hours?
Steps:
-
Before Insert BR on
incident -
Script: above
-
Checks business hours
Tables: incident.priority
13. Update Parent Change When Child Task is Updated
Q: Propagate child task state to parent change?
Steps:
-
Before Update BR on
task -
Condition:
parent exists -
Script: above
Tables: task.parent, change_request.state
14. Auto-Create Task for Critical Incident
Q: How to auto-generate a task for high-priority incidents?
Steps:
-
After Insert BR on
incident -
Condition:
priority = 1
Tables: task.short_description, task.incident
15. Notify Support Group When Incident is Reopened
Q: How to notify assigned group when incident is reopened?
Steps:
-
After Update BR
-
Condition:
state changes to Reopened
Tables: incident.state, incident.assignment_group
16. Prevent Duplicate Incidents for Same CI
Q: How to block duplicate incidents for same CI?
Steps:
-
Before Insert BR on
incident -
Script: above
Tables: incident.cmdb_ci, incident.active
17. Auto Update Impact Based on Priority
Q: How to adjust impact when priority changes?
Steps:
-
Before Update BR on
incident -
Condition:
priority changes
Tables: incident.priority, incident.impact
18. Close Child Tasks When Parent Incident is Closed
Q: Auto-close tasks when parent incident is closed
Steps:
-
After Update BR on
incident -
Condition:
state changes to Closed
Tables: task.parent, task.state
19. Restrict Incident Assignment to Self Only if VIP User
Q: How to restrict assignment changes for VIP users?
Steps:
-
Before Update BR on
incident -
Script: above
Tables: incident.assigned_to, incident.caller_id
20. Auto Set Incident State to In Progress When Assigned
Q: How to automatically move state to In Progress when assignment is done?
Steps:
-
Before Update BR on
incident -
Condition:
assigned_to changes
Tables: incident.assigned_to, incident.state
=======================================================================
. Auto-assign Incident based on Category
Q: How to automatically assign incidents based on category?
A: Create a before insert business rule on incident table.
Steps:
-
Navigate to Business Rules > New
-
Table:
incident -
When: Before Insert
-
Condition:
category == 'Network' -
Script: Add above snippet
Table/Backend Name: incident.assignment_group
2. Prevent Closing Incident if Work Notes are Empty
Q: How to prevent closing if work notes are empty?
A: Before Update BR on incident
Steps:
-
BR type: Before Update
-
Condition:
state changes to Closed -
Script: above
Table: incident.work_notes
3. Update Related Tasks When Incident Priority Changes
Q: How to propagate priority change to related tasks?
Steps:
-
Before Update BR on incident
-
Condition:
priority changes -
Script: above
Tables: incident.priority, task.parent
4. Auto Close Resolved Incidents after 7 Days
Q: Automatically close resolved incidents after 7 days
Steps:
-
Scheduled job or BR Before Update
-
Condition:
state=Resolved
Tables: incident.resolved_at, incident.state
5. Prevent Incident Assignment to Inactive Groups
Q: How to avoid assigning incidents to inactive groups?
Steps:
-
Before Insert/Update BR
-
Script: above
Tables: incident.assignment_group, sys_user_group.active
6. Notify Manager if Priority is High
Q: How to notify manager when priority is high?
Steps:
-
BR: After Insert/Update
-
Condition:
priority = 1 -
Event:
incident.high_priority
Tables: incident.priority, incident.assigned_to
7. Auto Set SLA Based on Category
Steps:
-
Before Insert BR
-
Table:
incident
Tables: incident.sla, incident.category
8. Prevent Incident Creation if CI is Under Maintenance
Tables: incident.cmdb_ci, cmdb_ci.maintenance_mode
9. Auto Populate Short Description Based on Category
Tables: incident.short_description, incident.category
10. Reopen Incident if Work Notes Added After Closure
Tables: incident.state, incident.work_notes
=================================================================================
FLOW DESIGNER BASED
1. Auto-Assign Incident Based on Category
Use case: Automatically assign incidents to a specific group based on the selected category.
-
Table:
incident -
Flow Trigger: Record created or updated (Incident table)
-
Flow Action: Script step
-
Script Example:
-
Commonly used: Daily for auto-assignment of tickets.
2. Notify Manager When High Priority Incident is Created
Use case: Send a notification to the manager if a P1/P2 incident is created.
-
Table:
incident -
Flow Trigger: Record created or updated
-
Flow Action: Script step
-
Flow Next Action: Use output
manager_emailin Send Email action.
3. Update Related Problem When Incident is Resolved
Use case: If all linked incidents to a problem are resolved, automatically close the problem.
-
Tables:
incident,problem -
Flow Trigger: Incident updated
-
Flow Action: Script step
-
Daily use: Keeps problem management clean.
4. Calculate SLA Breach Date Dynamically
Use case: When incident priority changes, update SLA breach date.
-
Table:
incident -
Flow Trigger: Record updated
-
Flow Action: Script step
-
Common: SLA management in ITSM.
5. Auto-Populate Short Description Based on Category
Use case: Auto-fill short_description field to standardize incident logging.
-
Table:
incident -
Flow Trigger: Record created
-
Flow Action: Script step
✅ Key Points About Flow Designer Scripting in ITSM
-
Tables used most commonly:
incident,problem,change_request,task. -
Triggers:
Record created,Record updated,Record deleted. -
Common actions in flows:
-
Send notifications
-
Update fields dynamically
-
Create related tasks (e.g., incident → problem or change request)
-
SLA updates
-
Auto-assignment and routing
-
-
Script step: Only use for dynamic or conditional logic not supported by normal Flow Designer actions.
-
Best practice: Avoid heavy GlideRecord queries in high-volume flows; consider scheduled flows for batch operations.
Comments
Post a Comment