Let's assume that in a large organization, when users request a service from a long list of offerings, it makes no sense if all the services go through the same set of approval processes. As most of the services would have a different set of approvers and approval levels, it is mandatory to customize the request approval processes. This post helps IT Administrators to dynamically set approvers at different approval stages directly in the request without the need to configure them in the template. With the help of Field and Form rules, the list of approvers are set in the request additional fields which will be used to send approvals.
Execution Steps:
1. Create new additional fields for the request to hold the approver information and update the api name in the script.
Goto: Admin > Incident Additional Fields
2. Each stage must be configured as a separate additional field.
3. Go to Admin > Service Templates > Select a particular template > Field and Form Rules > Rule execution - On Create / Edit > Event - "On Field Change" - "Requester" > Conditions - "Department=Network" >
(Or) We can leave the requester to fill in the approver's email id themself.
4. Similarly set values for the required number of stages and move status to "Waiting for approval".
5. Download the attached scripts. Copy the contents into Request custom functions.
6. Goto Admin > Request Custom Function > Custom Function > New > Paste the "FAFR_Approvals.txt" content and save it with a name
7. Configure a custom trigger to get invoked when the "Status" is "Waiting for approval". Go to Admin > Custom Trigger > give a trigger name > execute Custom Function > Select the Custom Function the we created and set the criteria as "Status=Waiting for approval"