Auto resolve case when related inc and chg is resolved and closed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 04:19 AM
Hi community
I have this current challenge where I need to auto resolve case (parent) when related inc AND/OR chg, req (childs) are resolved and closed.
I manage to auto resolve case when only incident is resolved, however, when a second task type is related it becomes harder. Any help is highly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 07:21 AM
Hi Ahn,
It sounds like you are using a pointer in either the incident or parent to resolve the incident. If you don't have a similar pointer in the change record there probably isn't a reliable mechanism for closing the parent. If that's the case then your best option is to create the relationship so that going forward you will be able to meet the requirement.
:{)
Helpful and Correct tags are appreciated and help others to find information faster
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 07:23 AM
If you have existing relationships between the records, you can create a business rule or flow to close them.
Can you share more info regarding how the relationships are setup, what you already tried, and where you're getting stuck?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 02:10 AM
Hi Mike
I am little unsure if i reply this correctly. But the relatikonships is that case is always the parent, where change and incident always will be the child.
This is the current script I have which is only resolving the auto close when the incident is resolved (which is not solving my challenge):
BR
Table: task
When: After update
(function executeRule(current, previous /*null when async*/) {
var caseGr = new GlideRecord("sn_customerservice_case");
caseGr.addQuery("incident",current.sys_id);
caseGr.addActiveQuery();
caseGr.query();
while(caseGr.next()) {
caseGr.state = 6; // resolved
caseGr.update();
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 07:53 AM
@Alex D Great Write 2 business rules as follows
1. Business rule on incident
When incident is resolved/closed
Check if at least one open (not resolved/closed) 'change request' which is associated same case as of incident is present.
If present then don't close the case. If not then close the case.
2. Business rule on 'change request'
When 'change request' is resolved/closed
Check if at least one open (not resolved/closed) incident which is associated same case as of 'change request' is present.
If present then don't close the case. If not then close the case.
Please mark as correct answer if this solves your issue
ServiceNow Community Rising Star, Class of 2023