How to send periodic notifications to requester(s) about their pending requests and accordingly update their status.

How to send periodic notifications to requester(s) about their pending requests and accordingly update their status.

This post describes the use of a python script to notify requester(s) about their requests through email and move those to a specific status.

Use Case: Let us assume a scenario where the technicians reply to a request and put it in a custom status called 'Waiting for Customer'. We can send reminder notification on 2 and 4 days This is achieved by running a query report in ServiceDesk plus which will return the ids of such requests.These are provided as input to a python script in JSON format. 

Execution steps:
1. Go to Reports--> New Query Report and run the below query and save this report.

select wo.workorderid "workorderid",
max(AaaContactInfo.EMAILID) "emailid",
max(woh.OPERATIONTIME) "last_tech_update" from workorder wo
LEFT JOIN SDUser sdu ON wo.REQUESTERID=sdu.USERID
LEFT JOIN AaaUser aau ON sdu.USERID=aau.USER_ID 
LEFT JOIN AaaUserContactInfo ON aau.USER_ID=AaaUserContactInfo.USER_ID 
LEFT JOIN AaaContactInfo ON AaaUserContactInfo.CONTACTINFO_ID=AaaContactInfo.CONTACTINFO_ID 
left join workorderstates wos on wo.workorderid=wos.workorderid
left join statusdefinition sd on wos.statusid=sd.statusid
LEFT JOIN WorkOrderHistory woh ON wo.WORKORDERID = woh.WORKORDERID
LEFT JOIN WorkOrderHistoryDiff wohd ON woh.HISTORYID = wohd.HISTORYID
where wo.isparent='1' and sd.ispending ='1' and  wohd.COLUMNNAME in ('STATUSID') and
sd.statusname = 'Waiting for Customer' and
wos.notificationstatus ='TECH_REPLY' group by wo.workorderid

This will give you the ID of requests that were created in this week and are in "Waiting for User" status.Please update the  STATUSNAME   based on your requirement.

2. Download and place the script file in the ManageEngine/ ServiceDesk/ integration/custom_scripts folder.
3. Update the application URL, Technician Key,  mail server details in configuration.json file
4. Configure the schedule under Admin--> Custom Schedule, like shown below.

A short guide on setting up python is available here.

                  New to ADSelfService Plus?

                    • Related Articles

                    • How to email pending requests list to technician periodically

                      This post describes the use of a python script to email pending requests to each technician in a periodic interval using Custom Schedules.This showcases the use of a feature called 'Custom Schedules' that was released in the build 9300 of ServiceDesk ...
                    • How to automatically close requests that are in a specific status.

                      This post describes the use of a python script to close requests that are put in a specific status using Custom Schedules.This showcases the use of a feature called 'Custom Schedules' that was released in the build 9300 of ServiceDesk Plus. What is ...
                    • Close the request upon adding a note.

                      Kindly follow the steps mentioned below: 1) Go to Admin >> Developer Space >> Custom Function >> Global Functions >> Copy & Paste the attached GF_Content.txt and save it with a name. Update the URL and technician key as per your instance. Refer to ...
                    • How to send custom email notifications for a request_NOT IN USE

                      This sample python script is used for sending custom notifications from ServiceDesk Plus MSP when a criteria is met.  You all know that ServiceDesk Plus MSP has notification rules and customisable templates to notify requesters, technicians, and ...
                    • Automatically close request after successive approval reminders.

                      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 ...