- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 03:51 PM
Hi Community,
I am having a real hard time with a customer request. They are asking me to put together a business rule where If a Case in sn_customerservice_case has a child ticket (Request or Incident) then if the Child Request or Incident are placed in "Closed Complete" (for request) or "Resolved" (for incident) then to auto-close the Case (parent)
Can someone show me at least a good start to what that code looks like? I would be most appreciative to help me get started.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 08:19 AM
Hey Jimmy,
I believe this code will help you.
It can depend how you are connecting the tickets, because for some cases as Requests, the tickets are connected by the field "Parent"
See an example for incident
var caseGr = new GlideRecord("sn_customerservice_case");
caseGr.addQuery("incident", current.sys_id);
caseGr.query();
while(caseGr.next()) {
caseGr.state = 6; // resolved
caseGr.update();
}
Please, mark this answer as correct if it helps you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 08:19 AM
Hey Jimmy,
I believe this code will help you.
It can depend how you are connecting the tickets, because for some cases as Requests, the tickets are connected by the field "Parent"
See an example for incident
var caseGr = new GlideRecord("sn_customerservice_case");
caseGr.addQuery("incident", current.sys_id);
caseGr.query();
while(caseGr.next()) {
caseGr.state = 6; // resolved
caseGr.update();
}
Please, mark this answer as correct if it helps you