Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Trigger only one approval request if manager and group owner is same person

2022_ServiceNow
Tera Expert

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

PavanK960672992
Mega Patron

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