Create a child case from Parent case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2023 11:34 PM
Hi,
I'm trying to populate parent case values to child case using the business rule but here the issue both the parent case and child case are from the same table but the below code is not working.
In the child case, we have parent case no as below.
code
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord('sn_customerservice_case');
gr.initialize();
gr.parent = current.sys_id;
gr.short_description = current.short_description;
gr.description = current.description;
gr.assigned_to = current.assigned_to;
gr.state = current.state;
gr.category = current.category;
gr.priority = current.priority;
gr.insert();
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 12:13 AM
Hi Vamshi,
Please change the query to after business rule and try.
Please accept the solution if it solves your query.
Thanks,
Ashish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 01:12 AM
Hi Ashish, I tried but it's not working.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 02:01 PM
Hi @Vamshi Krishna2 ,
What is your requirement, could elaborate further?
What I am seeing here, you are just creating a new record, whenever there is an existing record "abc" with some parent lets say "xyz", it will just create a new child record, with the parent set as "abc".
What exactly is the business use case here?
And what is selected for insert/update/query/delete?
Aman Kumar