To automate an approval for Incident Request Templates

To automate an approval for Incident Request Templates

Follow the below steps to add approval script.

1. Go to Admin --> Request Custom Functions -->Request --> Paste the content from the attachment 1. approvals.txt and save it with a name.

2. Configure the custom trigger as in the attached screenshot.


>>To set 2 approvers to approve the ticket, like either approved by approver  A or approver B please use the below script.

returnObj = Map();
approvalStages = [{"approver": {"id": 3301}},{"approver": {"id":3302}}];
input_data = {"INPUT_DATA":approvalStages,"OPERATIONNAME":"SET_APPROVAL","send_immediately":"True"};
operations = Collection();
operations.insert(input_data);
returnObj = {"operation":operations,"message":"Approval(S) added Successfully through Custom Trigger","result":"success"};
return returnObj;

NOTE:
Make sure to give the approver id in the script for whom the approval should be sent when an incident request is created.



                    New to ADSelfService Plus?

                      • Related Articles

                      • Convert Incident to Service Request

                        For builds before 10536 The option will be available at: open the respective request > Actions > Convert incident to service request For builds after 10600. Edit the respective request > click on the Template dropdown [top-right corner] > Choose the ...
                      • How to implement dynamic request approval using FAFR and custom triggers.

                        This is a sample script written in Python to handle Conditional Approvals for Incident \ Service Requests, through Custom Triggers using Field and Form Rules.  One of the advantages of using this script is that there is no modification of the script ...
                      • Document for Request Custom Menu and Custom Triggers

                        Attached a PDF file explaining with screenshots on how Request Custom Menu & Custom Triggers work.  
                      • Unable to save/edit Incident Templates

                        If you happen to see issue while editing an existing incident template, or error while saving new incident template created with the below error, (INVALID_CSRF_TOKEN) Then get the server.xml from the MSP\conf folder and make the below changes, ...
                      • How to close associated incident requests of change request automatically

                        This post describes the use of a python script to close change that are in a specific stage using Custom Schedules. Use Case: There may be a scenario where number of Change Requests that have got closed and the associated incident is still in open ...