Before BR condition not working properly

priceless
Tera Expert

Hi Team

Need a suggestion, I have written a before BR (on insert) on cmdb_rel_ci table. And in condition I have given as below. But the condition is not working for Child.support group i.e I want to copy parent support grp to child support group If Child.support group is empty. But after executing its copying the values properly but irrespective of child.class.support have vale or with empty. In Action am just setting Child support group Same as Parent support group.

 

Need suggestion on this.

 

5 REPLIES 5

priceless
Tera Expert

Hi Team

Any suggestion on this.

Hello @priceless ,

 

Can you please try by addition script and condition in advance tab as follows.

Sunny15_0-1693023121547.png

 

Condition : current.child.support_group==''

Script:

(function executeRule(current, previous /*null when async*/) {
	// Add your code here
	var gr= new GlideRecord(current.child.sys_class_name);
	gr.get(current.child.sys_id);
	gr.support_group=current.parent.support_group;
	gr.update();
})(current, previous);

 

 

Hope that helps!

If it did, please consider marking the reply as the Solution. Thanks!

Hello @priceless ,

 

Did you tried with remove Set field from action tab and adding condition to advance tab as mentioned above and if still not working can you please check if there any another BR which updating data?

 

Gaurav Shirsat
Mega Sage

Hello 

Have you tried with this .walk?

Child_Group.png

Thanks and Regards

Gaurav Shirsat