How to send notification mail to the Reporting Manager when a SLA is breached ?

How to send notification mail to the Reporting Manager when a SLA is breached ?

Use Case:  

When a SLA is getting breached, the technician's "ReportingTo" Manager has to be notified over email.

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 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.  Extract the attached SLA_BreachNotification.zip file under ..\ManageEngine\Servicedesk\integration\custom_scripts - folder. All files should be present under custom_scripts folder (Refer placing.png)

2.  Edit the configuration.json and update your mail configuration details and administrator technician key. You can generate the API Key from Personalize in the top right of the user interface.

3.  Login to the application and goto Reports -> New Query -> Execute the below query and save the report with a name.

select sduser.userid, sduser.reportingto, aaacontactinfo.emailid from sduser 
inner join aaausercontactinfo on aaausercontactinfo.user_id=sduser.reportingto
inner join aaacontactinfo on aaacontactinfo.contactinfo_id=aaausercontactinfo.contactinfo_id; 

4.  Goto Admin -> General -> Custom Schedules 

  • Configure a Custom Schedule with the above report as the Arguments.
  • In the Executor -> Provide py readJsonFromFile_Reportingto.py
  • Start Date & Time --> Give the time to execute it in few minutes.
  • Repeat -> None. (Means it will run only once)

(Refer - custom-schedules snapshot attached)

On completion of the schedule a reportingTo json file will be created in the custom script folder (This json is used to get the mail id of the reporting to user) . wait till you see the message Executed Successfully in the custom schedule page.

5. Now create a SLA and define action such that on SLA escalation set level as Tier4. (Refer SLA action)

6. Add a business rule with criteria as level is Tier 4, and action as Execute Script "py send_mail_reportingto.py $COMPLETE_V3_JSON_FILE" (place the value without quotes). (Refer BR action)

Now when the SLA response time is reached and the Level is set through the actions, then the control will go to the Business Rules and the trigger will get executed. ie mail will sent to the ticket owner's Reporting to Manager which is configured in the technicians page.







                  New to ADSelfService Plus?