Trigger only one approval request if manager and group owner is same person
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2023 07:14 AM
Hi,
I have a requirement the workflow.
I have worked on this workflow. If the user's manager and the group owner are the same or different person, it is triggering two approval requests.
But, in the catalog form, if the user's manager and the group owner are the same person, it should trigger only one approval request. How can I achieve this?
Thank you in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2023 08:30 AM
Hello,
In the workflow, you'd need to evaluate the user's manager and the group owner...using an if activity in workflow or if logic in flow designer and then if yes/true, request approval, otherwise, move on and do the next thing in the process.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 10:43 PM
Hi,
To do that, I need to get the value from the catalog form for the variable Group Owner and then check for condition whether Manager == group owner. I'm struggling in the scripting part. Can you please help me with it?
answer = skipApproval();
function skipApproval() {
var requested_for = current.variable_pool.requested_for_v1.getValue();
var sg_owner = current.variable_pool.v_ichs_sg_group_owner1.getValue();
var user = new GlideRecord("sys_user");
user.get(requested_for);
if (user.manager == current.v_ichs_sg_group_owner1) {
return 'yes';
}
return 'no';
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 06:38 AM
Hi,
Have you tried without scripting? And using the condition builder above the script field?
If by script, then:
answer = skipApproval();
function skipApproval() {
var requested_for = current.variables.requested_for_v1;
var sg_owner = current.variables.v_ichs_sg_group_owner1;
var user = new GlideRecord("sys_user");
user.get(requested_for);
if (user.getValue('manager') == sg_owner) {
return 'yes';
}
return 'no';
}
This is assuming you meant to use sg_owner instead of what you had in that if statement?
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 11:57 PM
Hi,
This is still not working. The condition for 'yes' is getting skipped even if the User manager is same as the Group owner.
What other changes can be made? Please let me know.
Thanks in advance!