Problem Closure and Related Incidents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 06:00 AM
Hi All,
My business requirement specifies that incidents/problems are set to Resolved to await caller feedback, at which point the incident/problem is set to Closed if the caller selects close in the email they receive (the email bit isnt set up yet).
I currently have a script that, when a problem is set to "Resolved", the related incidents also get set to "Resolved". At this point our SLA pauses to await the caller feedback.
I need to add the following, but my Javascript knowledge is very limited:
- The Problem to automatically close once all of the related incidents are set to closed.
- The problem cannot be set to closed when there are related incidents that have not yet been closed.
The current code I have in place is below (I didnt create it):
if (current.state.changesTo(8)) {
closeRelatedIncidents(current);
closeRelatedTasks(current);
}
//
// Close any incidents that are related to the current problem
//
function closeRelatedIncidents(me) {
var incident = new GlideRecord("incident");
incident.addQuery("problem_id", "=", me.sys_id);
incident.query();
while (incident.next()) {
if ( incident.state !== 'Closed' || incident.state !== 'Resolved' ){
var msg = "Incident " + incident.number + ' resolved by problem '+me.number +' and will be closed based on caller response.';
gs.print(msg);
incident.state.setValue(8);
incident.comments = msg;
incident.update();
}
}
}
If there's anoyone who has done what I need to do, how did you do it?!
Thanks i advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 08:06 AM
Yep. You can do this using Business Rule or even in a UI actions for closure. The code I have given is for BR.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 08:00 AM
Is state value '8' above closed or resolved?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 08:01 AM
8 is "Resolved" and 9 is "Closed".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 08:07 AM
Tom - Please update the state values for Close as defined in your instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 08:14 AM
My state values are already as I previously stated - 8 is "Resolved" and 9 is "Closed".