Script to send approvals to the users using distribution list

Script to send approvals to the users using distribution list

Request additional field

Create a Single Line Request additional field common for incident and service with name 'Last Approval Comments'. Replace the api name in the below function.

Global functions

1)

Function Name - Get Configurations

Return type - Map

API Name - getconfigurationfor

Parameters

configname - String


Note: Edit the URL, Technician key, and the additional field API name in the above function.

2)

Function Name - Generate Response

Return type - Map

API Name - generateresponse

Parameters

parameter_map - Map

method - String

configname - String

url - String


3)

Function Name -Approval configurations

Return type - Map

API Name - getapprovalconfig

Parameters

approveremailid - String

level - int

approverid - int


Note: Add the approvals in the above global function.

For the above 3 global functions kindly refer to the global_functions.zip folder

Approval Custom function

1)

Function Name - updaterequest

API Name - updaterequest

Type - Action



For the approval custom function refer to the approval_custom_function.zip

Request Custom Functions

1)

Function Name -approvalverification

Type - Condition

API Name - approvalverification

2)

Function Name - Conditional approvals for Incident and Service Requests

Type - Action

API Name - conditionapproval


For the above two request custom functions refer to the request_custom_function.zip

Custom trigger configurations

 

1) Approval Custom trigger

 

 

Configure criteria with the users for whom if mail is sent the chain of mails needs to be triggered.

2) Request Custom trigger

 

 

How this works

  1. When a user with an email id say test@abc.com is chosen in submit for approval, if there is configuration mentioned in getapprovalconfig for this email id, then the list of users configured for this email id will be triggered the approval flow.

  1. The content of the approval triggered will be based on the Approval template configured under Notification rules.

      3. The level of approval will be the same as the original approval triggered from UI.

                    New to ADSelfService Plus?