Trigger only one approval request if manager and group owner is same person
Options
- 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.
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 09:33 AM
Hi @2022_ServiceNow ,
try below
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.manager == sg_owner) {
return 'yes';
} else {
return 'no';
}
}
If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar