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

Michael Jones -
Giga Sage

When a group approval activity is first created, the approval user will always be empty; that field is only filled in once someone from the group has actually performed an approval. There should be records under the Approvers Related List for each of the group members; once you complete one of those individual approvals, the name of the Approver User will be populated on the group approval. This is by design. 

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!

The approver has approved here but still his name is not coming in Approval User field. That is the problem. Approver has approved. In the group approval tab the state is set to approved but approval user is still empty.

Sorry for the misunderstanding; I do seem to recall something similar occurring when manually creating a group approval (clicking new from the related list for example). Maybe the same thing is happening when you create the approval via a script; I'm not why the method of creation would matter, but I did confirm that I see the same results today in an Orlando PDI when I manually create a group approval and approve it (the approval user is not set).

When I create an approval using a workflow and approve it, the approval user is set. 

Seems like some element in the chain is being broken when the approval isn't created through one of the standard mechanisms perhaps? Might count as a bug.

You could probably work-around it with a business rule on the sysapproval_approver table. On approve (after), check to see if a group approval is associated (group field is not empty) and if so, update that record with the current.approver.

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!

Can you share my the sample to be written inside Business rule. I guess l am not very clear.