How to setup a manager approval for all employees irrespective of their designation

Deeplaxmi
Tera Contributor

Hi All,

 

I want to setup a manager approval for all employees irrespective of their designation in a catalog item

 

What I have done so far is as below :

Now I did not modify any item workflow as its a common workflow used for many catalog items.

So as advised, I am using approval definition.

 

So I created an approval type named "Manager approval for all users zyz"

I selected Type = script and Script output = User(s).

I tried below different codes but no luck. And then I created an approval definition with type = "predefined approval type" and for predefined approval field, I selected the above created approval type as "Manager approval for all users zyz".

 

Below codes tried by me for approval type named "Manager approval for all users zyz"

 

(function() {

-> Below Code 1

    /*var requestor = current.requested_for.getDisplayValue();

 

    var manager = GlideUser(requestor).getManager();

 

    if (manager) {

        current.approver = manager;

        current.state = 'requested';

        current.update();}

 

->Below code 2

var approversList = [];

    approversList.push(current.variables.requester_name.manager);

 

    return approversList;*/

 

->Below code 3

 var approversList = [];

    

        approversList.push(current.variables.requested_for.manager);

    return approversList;

 

})();

 

Can you please help me with code or suggest code or let me know what else can be done. Your help is highly appreciated, Thanks !

 

Thank you

5 REPLIES 5

Hi Sruthi,

 

Actually, we have a single predefined catalog workflow for more than 1 catalog items. So if I modify the workflow then will it get applied to all the other catalog items as well?

 

Is there any way to do from an approval definition only for that particular catalog item?