- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2024 06:44 AM
Hello,
I would like to have certain fields from an HR parent case to populate in the child case upon creation. For example, if the parent case has the watchlist populated, I'd like to configure something where the child case will pull the watchlist from the parent & populate it with the same names. What is the best way to do something like this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 11:54 AM - edited ‎04-25-2024 11:55 AM
Hey @Msteiner94 -
I created a script within a business rule that will work - but I only used your example using the Watch List. You will need to generate more like what I have here, to copy more.
Here is the BR:
I have When to Run as Before, and I have Insert and Update equal to True
Script:
(function executeRule(current, previous /*null when async*/ ) {
var gr = new GlideRecord("sn_hr_core_case");
gr.addQuery("parent", current.sys_id);
gr.query();
while (gr.next()) {
gr.watch_list = current.watch_list;
gr.update();
}
})(current, previous);
Parent Case: (These are all OOTB Demo Data loaded so no need to block out personal info)
Child Case(s):
When I add users to the Watch List of the Parent Case and Save/Update the record:
Here are the Child Case(s):
Everyone I added in the Parent case have been added to the Child Case(s).
Give this a try, and if you need additional help please let us know!
Cheers,
-Rob
*p.s. Please don't forget to mark a reply as Helpful or Correct when appropriate*

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 11:54 AM - edited ‎04-25-2024 11:55 AM
Hey @Msteiner94 -
I created a script within a business rule that will work - but I only used your example using the Watch List. You will need to generate more like what I have here, to copy more.
Here is the BR:
I have When to Run as Before, and I have Insert and Update equal to True
Script:
(function executeRule(current, previous /*null when async*/ ) {
var gr = new GlideRecord("sn_hr_core_case");
gr.addQuery("parent", current.sys_id);
gr.query();
while (gr.next()) {
gr.watch_list = current.watch_list;
gr.update();
}
})(current, previous);
Parent Case: (These are all OOTB Demo Data loaded so no need to block out personal info)
Child Case(s):
When I add users to the Watch List of the Parent Case and Save/Update the record:
Here are the Child Case(s):
Everyone I added in the Parent case have been added to the Child Case(s).
Give this a try, and if you need additional help please let us know!
Cheers,
-Rob
*p.s. Please don't forget to mark a reply as Helpful or Correct when appropriate*