Skip to content

Commit f7503aa

Browse files
authored
CloseChildCases.js
1 parent 599f55e commit f7503aa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var gr = new GlideRecord('sn_customerservice_case');
2+
gr.addQuery('parent', current.sys_id);
3+
gr.query();
4+
var counter = 0;
5+
while (gr.next()) {
6+
if (gr.state != 3) {
7+
gr.resolution_code = '16';
8+
gr.close_notes = 'This case was auto closed from the parent case.';
9+
gr.state = '3';
10+
gr.update();
11+
counter++;
12+
}
13+
}
14+
gs.addInfoMessage(counter + ' cases have been closed.');
15+
action.setRedirectURL(current);

0 commit comments

Comments
 (0)