Script to send custom reminder notification to notify task owner based on scheduled start and end time.

Script to send custom reminder notification to notify task owner based on scheduled start and end time.

Prerequisites:

2. functions.py  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 use case, we can include these functions in our script. 
3. configuration.json : This file maintains the configuration details of the installed server.  

Note: Create separate custom schedules for Task Assigned Date and for Task Schedule End Date.

Execution steps:    

1.  Execute both the below queries and save the report with a title.

Query:  Task Assigned Date:

SELECT projectdet.PROJECTID AS "projectID", 
(projectdet.TITLE) AS "title", 
(projectstatus.STATUSNAME) AS "status",
taskdet.TaskID "taskID",
(taskdet.TITLE) "title",
(taskowner.FIRST_NAME) "owner",
(AaaContactInfo.EMAILID) "emailID",
(taskstatus.STATUSNAME) "task_status",
(taskdet.createddate) "task_time" FROM ProjectDetails projectdet 
LEFT JOIN ProjectStatus projectstatus ON projectdet.STATUSID=projectstatus.STATUSID 
LEFT JOIN ProjectAccMapping ON projectdet.PROJECTID=ProjectAccMapping.PROJECTID 
Inner JOIN TaskToProjects tpr ON projectdet.PROJECTID= tpr.PROJECTID 
LEFT JOIN TaskDetails taskdet ON tpr.TASKID=taskdet.TASKID 
LEFT JOIN SDUser taskownersdu ON taskdet.OWNERID=taskownersdu.USERID 
LEFT JOIN AaaUser taskowner ON taskownersdu.USERID=taskowner.USER_ID 
LEFT JOIN AaaUserContactInfo ON taskowner.USER_ID=AaaUserContactInfo.USER_ID 
LEFT JOIN AaaContactInfo ON AaaUserContactInfo.CONTACTINFO_ID=AaaContactInfo.CONTACTINFO_ID 
LEFT JOIN StatusDefinition taskstatus ON taskdet.STATUSID=taskstatus.STATUSID
where taskstatus.statusname= 'open' and projectstatus.statusname= 'open' and taskowner.FIRST_NAME is not null


Query:  Task Schedule End Date:

SELECT projectdet.PROJECTID AS "projectID", 
(projectdet.TITLE) AS "title", 
(projectstatus.STATUSNAME) AS "status",
taskdet.TaskID "taskID",
(taskdet.TITLE) "title",
(taskowner.FIRST_NAME) "owner",
(AaaContactInfo.EMAILID) "emailID",
(taskstatus.STATUSNAME) "task_status",
(taskdet.SCHEDULEDENDTIME) "task_time" FROM ProjectDetails projectdet 
LEFT JOIN ProjectStatus projectstatus ON projectdet.STATUSID=projectstatus.STATUSID 
LEFT JOIN ProjectAccMapping ON projectdet.PROJECTID=ProjectAccMapping.PROJECTID 
Inner JOIN TaskToProjects tpr ON projectdet.PROJECTID= tpr.PROJECTID 
LEFT JOIN TaskDetails taskdet ON tpr.TASKID=taskdet.TASKID 
LEFT JOIN SDUser taskownersdu ON taskdet.OWNERID=taskownersdu.USERID 
LEFT JOIN AaaUser taskowner ON taskownersdu.USERID=taskowner.USER_ID 
LEFT JOIN AaaUserContactInfo ON taskowner.USER_ID=AaaUserContactInfo.USER_ID 
LEFT JOIN AaaContactInfo ON AaaUserContactInfo.CONTACTINFO_ID=AaaContactInfo.CONTACTINFO_ID 
LEFT JOIN StatusDefinition taskstatus ON taskdet.STATUSID=taskstatus.STATUSID
where taskstatus.statusname= 'open' and projectstatus.statusname= 'open' and taskowner.FIRST_NAME is not null


2.  Extract the attached script file in ZIP under ..\ManageEngine\ServicedeskPlus MSP\integration\custom_scripts - folder.

3.  Edit the configuration.json and update the values.

4.  Create a file in a text format with the value py reminderMail.py and place it in the executor file.

\ManageEngine\ServiceDeskPlus-MSP 13000\integration\custom_scripts\executor_files - txt file

5.  Configure a custom schedule to execute everyday and pass this report as a parameter.

6.  Go to Admin > Custom Schedule > give a schedule name > execute script >enter the executor file name(should be in .txt format)

7. In the arguments place the saved reports.


                New to ADManager Plus?

                  New to ADSelfService Plus?