Return Incident to In Progress from On Hold
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2024 05:30 AM
As the Incident Manager, I want the system to automatically return an Incident to In Progress if it's currently On Hold when the reason it's on hold has been resolved.
I will know this is complete when an On Hold Incident returns to In Progress under the following conditions
- If the reason is Awaiting Caller, after 3 business days (M-F) if not updated by the Caller
- If the reason is Awaiting Change, when the related Change is closed
- If the reason is Awaiting Problem, when the related Problem is closed
- If the reason is Awaiting Vendor, after 7 business days (M-F)
Please, I need help with this requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2024 05:04 AM
To automate the process of returning an Incident to "In Progress" when it's on "On Hold" for specific reasons in ServiceNow, you can implement the solution using Scheduled Jobs, Business Rules, and Workflow Triggers. Here's a breakdown of how to handle each condition:
1. If the reason is "Awaiting Caller" (after 3 business days):
- Scheduled Job:
- Create a Scheduled Job that runs daily to check incidents on hold with the "Awaiting Caller" state.
- Use the SLA engine or business calendar to ensure you're counting only business days (M-F).
- If the incident has been in this state for more than 3 business days and no updates were made by the caller, move it back to "In Progress".
Example Script for a Scheduled Job:
var gr = new GlideRecord('incident');
gr.addEncodedQuery('state=On Hold^hold_reason=Awaiting Caller^sys_updated_on<=javascript:gs.beginningOfLast3BusinessDays()');
gr.query();
while (gr.next()) {
gr.state = 'In Progress'; // Update the state to In Progress
gr.update();
}
2. If the reason is "Awaiting Change" (when the related Change is closed):
- Business Rule:
- Create an After Business Rule on the Change table.
- When a related Change request is closed (i.e., state is changed to "Closed"), check if there are any Incidents linked to this change with a hold reason of "Awaiting Change." If yes, return them to "In Progress."
Example Script for the Business Rule:
var incGr = new GlideRecord('incident');
incGr.addQuery('hold_reason', 'Awaiting Change');
incGr.addQuery('u_related_change', current.sys_id); // Assuming u_related_change holds the related Change request
incGr.query();
while (incGr.next()) {
incGr.state = 'In Progress';
incGr.update();
}
3. If the reason is "Awaiting Problem" (when the related Problem is closed):
- Business Rule:
- Similarly, create an After Business Rule on the Problem table.
- When a related Problem is closed, move any related Incident back to "In Progress."
Example Script:
var incGr = new GlideRecord('incident');
incGr.addQuery('hold_reason', 'Awaiting Problem');
incGr.addQuery('u_related_problem', current.sys_id); // Assuming u_related_problem holds the related Problem
incGr.query();
while (incGr.next()) {
incGr.state = 'In Progress';
incGr.update();
}
4. If the reason is "Awaiting Vendor" (after 7 business days):
- Scheduled Job:
- Create another Scheduled Job that runs daily and checks for incidents on hold with the "Awaiting Vendor" reason.
- Use the SLA engine to count 7 business days (M-F) and move incidents back to "In Progress" if the time has passed.
Example Script for a Scheduled Job:
var gr = new GlideRecord('incident');
gr.addEncodedQuery('state=On Hold^hold_reason=Awaiting Vendor^sys_updated_on<=javascript:gs.beginningOfLast7BusinessDays()');
gr.query();
while (gr.next()) {
gr.state = 'In Progress';
gr.update();
}
If this solution helps, please mark this solution as accepted and helpful!
Thanks & Regards,
Siddhesh Jadhav