Approval User field is blank in Group Approval Related List in Service Now

saikatmitra
Tera Contributor

Hi Team,

I have written one "Approval Group" activity in Service Now to trigger the approval group "ISRC" through advanced script which is working fine.

The problem is now after the approval group is triggered and approved, the Approval User field remains blank in Group Approval Related List in Service Now. I want the user approved to be populated under the  Approval User field  for the ISRC group. Please help with your advise. The screenshot is given below.

 

find_real_file.png

1 ACCEPTED SOLUTION

Something like this seems to do the trick: 

find_real_file.png

click advanced and add a script like this: 

(function executeRule(current, previous /*null when async*/) {

	
	var ga = new GlideRecord('sysapproval_group');
	ga.get(current.group);
	ga.approval_user = current.approver;
	ga.update();

})(current, previous);

Hope this helps!

If this was helpful or correct, please be kind and click appropriately!

Michael Jones - Proud member of the CloudPires Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

View solution in original post

7 REPLIES 7

It seems like your understanding is correct. Workflow normal works fine but with script approval user is not set once approved.

Something like this seems to do the trick: 

find_real_file.png

click advanced and add a script like this: 

(function executeRule(current, previous /*null when async*/) {

	
	var ga = new GlideRecord('sysapproval_group');
	ga.get(current.group);
	ga.approval_user = current.approver;
	ga.update();

})(current, previous);

Hope this helps!

If this was helpful or correct, please be kind and click appropriately!

Michael Jones - Proud member of the CloudPires Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

That's cool. It is working. Thanks. I was writing the same business rules but in some wrong table. I realized sysapproval_group is the correct group. Thanks a lot.