Parent and Child Improvement - Resolution Pop Up Message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2024 12:25 AM
I have been tasked with completing a Pop up message within Incidents to alert users once trying to resolve a Parent Incident that all relevant Child Tickets still apply. I want the message to pop up upon adding state into Resolved but follow the below rules:
Not for Severity / Priority 1 or 2 Incidents
Non Production
Nor when Parent has no Child incidents
I've seen there may be a few options but being new to this area would appreciate and advise feedback recommendations on how to action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2024 05:36 AM
A Client Script can be added to the Incident form, triggered on the 'state' field change. It checks the Incident's attributes and the related Child Incidents to determine if the pop-up should be displayed.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var incident = g_form.getRecord();
if (incident.state == 'Resolved' && incident.severity != 1 && incident.severity != 2 && incident.priority != 1 && incident.priority != 2 && incident.u_environment != 'Production') {
var childIncidents = new GlideRecord('incident');
childIncidents.addQuery('parent_incident', incident.sys_id);
childIncidents.query();
if (childIncidents.hasNext()) {
g_form.showFieldMsg('state', 'Child incidents exist. Please resolve them before resolving parent incident.', 'error');
g_form.clearValue('state');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2024 05:51 AM
Thanks will take a look with this is there an option to have Yes / No on the pop up as i can see most we have are OK / Cancel