Script to send reminder emails to requester when there is no response from them for more than a specified time period

Script to send reminder emails to requester when there is no response from them for more than a specified time period

There are scenarios where if the end-user is not responding for a specified period of time they need to be reminded of the same. This can be achieved using a script.

Use case: 

Reminder emails should be triggered to requester when the request is moved to a custom status and left unattended for more than a said time.
For eg., In this case, three reminder mails will be sent to the requester in different time intervals after the request status change.
First reminder mail will be sent when its 1 day past the request update.  Second mail will be sent when its 3 days, and final reminder will be sent when its 5 days past the last request update.  After which the ticket will be automatically closed.

1. Python is a third party software that has to be installed on the server in which MSP is installed. Here is the link for Installation Steps,
2. :  This package consists of all the functions that are used to handle the standard requirements of the customer.  Most repeated requirements are written as separate functions.  Depending on our usecase, we can include these functions in our script. 
3. configuration.json : This file maintains the configuration details of the installed server.  

Execution steps:    
1.  Execute the below query and save the report with a title.

select workorder.workorderid, aaacontactinfo.emailid, workorderstates.last_tech_update from workorder
inner join workorderstates on workorder.workorderid=workorderstates.workorderid
inner join statusdefinition on workorderstates.statusid=statusdefinition.statusid
inner join aaauser on workorder.requesterid=aaauser.user_id
inner join aaausercontactinfo on aaauser.user_id=aaausercontactinfo.user_id
inner join aaacontactinfo on aaausercontactinfo.contactinfo_id=aaacontactinfo.contactinfo_id
where statusdefinition.statusname='waiting for user reply'

You can edit the above query and set the status to any custom status for which you want the reminder emails to be sent.

2.  Extract the ZIP file under ..\ManageEngine\ServiceDeskPlus-MSP\integration\custom_scripts - folder.
3.  Edit the configuration.json and update the values.
4.  Configure a custom schedule to execute everyday and pass this report as a parameter.
5.  Go to Admin > Custom Schedule > give a schedule name > execute script > py

Custom Schedule:

Reminder Notification to the end-user will look like below,

Here the script will send reminder notifications before 1,3 and 5 days respectively. If you want you can customize the days in the file.

                    New to ADSelfService Plus?