This post describes the use of a python script to close requests after successive approval reminders using Custom Schedules.
Use Case:
We have an option under the self-service portal in order to send reminders mail for the approvals, what would be the case once all the mentioned reminders are sent and still the ticket remains unnoticed, and the technician needs to have a look at the pending every once in a while .
We can configure a custom schedule to close the requests, and also add a note in the ticket stating "closing the request since the approver has not approved after repeated follow ups"
Execution steps:
1. Go to Reports--> New Query Report and run the below query and save this report.
SELECT wo.WORKORDERID AS "workorderid" FROM WorkOrder wo
LEFT JOIN WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID LEFT JOIN StatusDefinition std ON wos.STATUSID=std.STATUSID
LEFT JOIN ApprovalStatusDefinition appStDef ON wos.APPR_STATUSID=appStDef.STATUSID
LEFT JOIN Approvalstagemapping on wo.workorderid=approvalstagemapping.workorderid
LEFT JOIN Approvaldetails on approvaldetails.approval_stageid=approvalstagemapping.approval_stageid
left join approvalreminder ar on Approvaldetails.approvalid=ar.approvalid
WHERE (wo.ISPARENT='1') and std.ispending='1' and appStDef.STATUSNAME like '%pending%' and ar.Reminder_count = 3 group by wo.workorderid
2. Downloaded the attached Zip file and move the files to ManageEngine/ ServiceDesk/ integration/custom_scripts folder
3. Edit configuration.json file and update the application URL and the Technician Key
4. Configure the schedule under Admin--> Custom Schedule
I've attached a screenshot showing a sample implementation below.
A short guide on setting up python is available
here
Refer to the link below in order to setup the schedule,