Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Workflow Approval - User activity

The Matrix
Tera Contributor

Hi Team,

I have created an Approval for RITM using Workflow Approval - User activity and adding approvers using sys id in Advanced Script.  Refer below image.

TheMatrix_2-1765345638876.png

 

 

TheMatrix_3-1765345662512.png

 

 

TheMatrix_0-1765345107929.png

TheMatrix_1-1765345601629.png

 

For wait for condition I have set "Anyone to approve" 

and When anyone rejects " Rejects the Approval". 

 

The Approval is only working only for the first User whom I'm pushing first in the answer[] array. If the second user approves the RITM it is not moving to the next activity. It should work either one of them approves it.  What do you think, what am I missing here?

 

3 REPLIES 3

Matthew Green2
Tera Contributor

“Anyone to approve” only works if each approver gets a separate approval record.
Your Advanced Script is likely not returning an array, so only the first user is getting a requested approval.

Fix it by ensuring the script does this:

 

answer = [];
answer.push('SYSID_USER1');
answer.push('SYSID_USER2');

 

Then confirm the RITM has two sysapproval_approver records.

Hi @Matthew Green2 both the users are getting approval request and two seperate approvals records are created in sysapproval_approver. The expected scenario is, that it should move to the next Activity if either one of them approves the request. But it is working for only first user from the answer[] array. If the second user approves the request, the state is chaning to Approve but it is not moving to the next activity? 

Thanks!

TheMatrix_1-1765347513733.png

 

TheMatrix_0-1765347319644.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@The Matrix 

should work fine ideally.

Did you try to give some other user sysIds in array?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader