- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2020 11:04 AM
I have this script (found on community) and it's working. It pulls the list of approvers and adds to the RITM approval record. Some of the items in list collector variable (teradata_options) have multiple approvers and we only need 1 approval for each item selected. If we have multiple options selected in the list collector, of course we have multiple groups of approvers. If we use Approval-User in the workflow, then the approval isn't waiting on everyone from each group/item approval. If we use Approval-Group, it's skipping the approval.
ADDITIONAL APPROVERS SCRIPT
answer = myScript();
function myScript() {
var app = current.variables.teradata_options.toString();
var list = app.split(',');
var appList = [];
for (var i = 0; i < list.length; i++) {
var ci = new GlideRecord('u_key_word');
if (ci.get(list[i])) {
appList.push(ci.getValue('u_approvers'.toString()));
//gs.log("andrea " + applist + ci.u_approvers);
//appList.push(ci.getValue('u_approvers'));
}
}
return appList;
}
APPROVAL - USER in Workflow
APPROVAL - GROUP in Workflow
Options on Catalog Item and the approvers in group 1 and 2, with manager approval. Someone from group 1 needed to approve.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 12:10 PM
From the teradata_options can you identify which ones are #1 approvers, #2 approver, and manager? If yes, you can create multiple Approval - users.
The Approval User workflow activity is looking for users, but the Approval Group is looking for group names. Since you're sending Users, Approval Group isn't working. Can you send groups?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2020 05:19 PM
How about introducing an Array and then use Unique to filter out the duplicates. Obviously do this before pushing to appList. https://docs.servicenow.com/bundle/newyork-application-development/page/app-store/dev_portal/API_ref...
Once you have unique values, change the Approval - User workflow activity, Wait for - All approvals.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 11:01 AM
Thank you for the reply Michael, I may not have explained it correctly. We actually don't have duplicates. Like in this example, we have 3 people that receive the approval for one of the options. Only 1 from that group needs to approve. Then we need the approval from Roger, he's the approver for a different option that was selected.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 12:10 PM
From the teradata_options can you identify which ones are #1 approvers, #2 approver, and manager? If yes, you can create multiple Approval - users.
The Approval User workflow activity is looking for users, but the Approval Group is looking for group names. Since you're sending Users, Approval Group isn't working. Can you send groups?