In catalog form, based on list collector selection values the approvals should trigger.

Pidikiti Bhanut
Tera Contributor

Hi All,

 

Only One Approval should trigger if managers are same for multiple servers, but if the managers are different for each server, then each approval should trigger to respective manager separately.

How can I achieve this requirement through workflow using run script activity.

Here is the requirement

The manager field (is owned by) is referring to this  table cmdb_ci_linux_server.For reference I have attached screenshot for the values.

7 REPLIES 7

Mark Manders
Mega Patron

You will need to find the managers, loop through them to see if there is already an approval record and if not, create one. Or go the easy way and move away from run script activity and use the flow designer.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Sujatha V M
Kilo Patron
Kilo Patron

@Pidikiti Bhanut Below is my implementation steps followed based on the use case, 

 

1. Created a list collector field to select multiple servers and linked to cmdb_ci_linux_server table. 

 

SujathaVM_0-1718038539563.png

 

2. Created another list collector field to list the managers of the selected servers using script include and onChange catalog client script. 

 

SujathaVM_1-1718038574238.png

 

Note: Make it as read only and hide it on the form if required. 

 

Catalog client script : onChange of Server selected 

 

SujathaVM_2-1718038614810.png

 

Script Includes: 

SujathaVM_3-1718038687892.png

 

3. Pushed the managers to the approval activity in the workflow. As suggested by @Mark Manders go ahead with flow designer if possible. 

SujathaVM_4-1718038708303.png

SujathaVM_6-1718038802416.png

 

4. Set the approval activity, approve selection as "Everyone to approve" incase of multiple managers (owned by)

SujathaVM_7-1718038824909.png

 

Results: 

 

Multiple Servers - Same Manager

SujathaVM_9-1718039017604.png

 

Multiple Servers - Different Managers

SujathaVM_8-1718038916632.png

 

Please mark this as helpful and accept it as a solution if this resolves your query.

Thanks,

Sujatha V.M.

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

Pidikiti Bhanut
Tera Contributor

Hi @Ankur Bawiskar @Sandeep Rajput @Anurag Tripathi @Community Alums , help me to reach out solutions on this.

Ankur Bawiskar
Tera Patron
Tera Patron

@Pidikiti Bhanut 

so what did you start with and where are you stuck?

1 server will have only 1 manager.

Are you allowing user to select multiple servers on catalog form?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader