Business rule to Populate all the variables and mulitirow variables on parent case to child case
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 11:24 PM
Please help me with the Business rule script to Populate all the variables and mulitirow variables on parent case to child case.
The parent case is created after submitting the request from the portal and the child case is created once the parent case state changed to resolved. Both parent and child are creating on the same table.
Thank you in advance!
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 11:36 PM
var grCase = new GlideRecord("table_name");
grCase.addQuery("sys_id", current.parent); // replace field name
grCase.query();
if (grCase.next()) {
for (var prop in grCTask.variables) {
current.variables[prop] = grCase.variables[prop];
}
}
current.variables.<multi_row_variable_set_name1>=JSON.parse(grCase.variables.multi_row_variable_set_name1);
current.variables.<multi_row_variable_set_name2>=JSON.parse(grCase.variables.multi_row_variable_set_name2);