Business rule to Populate all the variables and mulitirow variables on parent case to child case

Sai Santhoshi
Tera Contributor

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

Shruti
Mega Sage
Mega Sage
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);