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.