- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2022 02:18 PM
Hi I am looking for some guidance on how to automatically close case tasks once parent case is closed.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2022 09:33 PM
Hi @Vic4 ,
1.Create the After Business rule on case(sn_customerservice_case) table and when to run tab check update and give condition as state changes to closed. And use below script.
(function executeRule(current, previous /*null when async*/ ) {
var cstsk = new GlideRecord('sn_customerservice_task');
cstsk.addQuery('parent', current.sys_id); //filter the current case record
cstsk.query();
while (cstsk.next()) {
cstsk.state = '3'; //add task close state value
cstsk.update();
}
})(current, previous);
2. Refer below Business rule screenshots:
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2022 09:55 PM
Hi @Vic4 ,
There is not currently anything in the platform shipped Out of Box (OOB) as of Rome within Case which has this same idea/functionality.
if needed this sort of functionality in yourr instance, you could simply review the Service Catalog "Close Parent if Required" Business Rule and modify it for the Case table according to their business needs. That way, whenever all Case Tasks (CSTASK) on a Case were closed, the parent case would close also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2022 09:33 PM
Hi @Vic4 ,
1.Create the After Business rule on case(sn_customerservice_case) table and when to run tab check update and give condition as state changes to closed. And use below script.
(function executeRule(current, previous /*null when async*/ ) {
var cstsk = new GlideRecord('sn_customerservice_task');
cstsk.addQuery('parent', current.sys_id); //filter the current case record
cstsk.query();
while (cstsk.next()) {
cstsk.state = '3'; //add task close state value
cstsk.update();
}
})(current, previous);
2. Refer below Business rule screenshots:
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2022 09:55 PM
Hi @Vic4 ,
There is not currently anything in the platform shipped Out of Box (OOB) as of Rome within Case which has this same idea/functionality.
if needed this sort of functionality in yourr instance, you could simply review the Service Catalog "Close Parent if Required" Business Rule and modify it for the Case table according to their business needs. That way, whenever all Case Tasks (CSTASK) on a Case were closed, the parent case would close also.