Scheduled Alerts


Definition

An alert acts like an agent for the monitoring of key activities of the company (assets, employees, incidents, requests, ...).

  • It allows to send mails and to start an action automatically (an update of the database, a mail notification,...) when a defined threshold is reached.
  • It is scheduled to be executed at a given frequency.
EndDefinition

Each alert:

  • Is built out of a filter using a parent query contextual with the module to which it is attached; 
  • Returns a result from the measuring mesure selected for the calculation of the alert (number of records, sum or average of values resulting from the filter);
  • Needs to be enabled to trigger its frequency for calculation;
  • Appears in the scheduled tasks once scheduled and enabled;
  • May be recalculated at any time to display its current value;
  • May produce a notification sent to users via email with a hyperlink for a direct connection to a view;
  • Is attached to a folder allowing organizing alerts depending on their function.

Examples

  • Execution of an SQL script on the database to increase the priority level of action being late.
  • Creation of an alert Employees leaving the company to send a mail notification to the person in charge of the stock of equipments including a direct hyperlink to a view allowing displaying the related employees and the list of equipments that should be returned to stock.
    Implementation:
    • Parent query Employees
    • Frequency:
      • Filter: Departure Date = Next Month
      • Measuring unit: Number of records
      • Alert condition: 1
      • Frequency of the calculation: Each 1st of the month, at 6 am

Result: On each first of the month at 6 am, the alert is triggered and will evaluate the number of employees leaving the company. If at least one record is found, an email is sent to the person in charge of the stock of equipments.

Notes

  • Only when you create a new alert, you may create a new parent query. This one is associated to the alert and it will also be available on all pages using a parent query.
  • You may add other fields manually to the parent query of the alert (under the condition to own the edit rights for the displays of the module): Click on Edit icon.png related to this field.
  • Notification mail:
    • The sender of the email is the one specified in the parameter MAILER_SCHEDULER.
    • The recipients defined by the means of roles do not receive the direct link to the views.
  • If the execution of the alert is not triggered, check that the scheduler is started and that all parameters are correct.

Caution

  • You should pay attention to carefully design the filter in the alert or you might delete the better part of your data.
  • It is recommended to use a filter with the explicit incident numbers you want to update or to delete to avoid changing unwanted records

Best Practice big icon.pngBest practice

  • When creating an alert, check the correct operation of alerts immediately by entering a date for the first calculation prior to the current date.
  • To start an alert once, define a launch date that is before the current date. The alert will be launched as soon as it's saved. Unactivate the alert after that execution to prevent future executions. 
  • When the alert triggers a notification mail, add a view so that the recipients receive an email with a hyperlink for a direct connection to this one.
  • In order to avoid to slow down the network performances, schedule the execution of alerts outwards the periods where many users need to access Product name - ev itsm.png (Overnight or during the weekends).
  • When the triggering of a scheduled alert A depends on the end of execution of a scheduled alert B with an uncertain processing duration (Variability due to volumes to process, access time...), it is advised to define and to plan a sequencing of tasks between these two processes rather than to define a fixed frequency for the scheduled alert A.

Screens description

Menu access: Administration > Alerts > Scheduled Alerts

Main Information

         Alert - step 1.png

Name: Description identifying the alert. 

Comment: Free area allowing entering details about the alert.

Folder Name: Folder name for the alerts, specifying where the alert is saved.

Parent Query (Note: Only for a Standard alert): Name of the parent query to which is attached the alert.

  • You may create a new parent query via Add icon.png (Note: Only when you create a new alert and if you did not select a parent query).
  • You may add fields manually via Edit icon.png.

Form (Note: Only for a Standard alert): Name of the form to open when the user selects a record in the view attached to the alert notification. Note: Only the forms related to the parent query will be proposed.

   The display mode of the form depends on the selected option:

  • Integrated: Display of the record in Form mode; The user can change the information depending on his rights. The icon Display popup icon.png is positioned at the beginning of each line of the reporting.
  • Pop-up: Display of contextual information about the record in a secondary window; The information cannot be changed. The icon Display popup icon.png is positioned at the end of each line of the reporting.

Alert Type: Alert type indicating how is defined its alert condition.

  • Standard: The threshold is set to the number of records, the sum or the average of the values from the filter.
  • Percentage: The threshold is set between two alert values defined in Step 3 (Fields Dividend and Divider). It returns a number of record and does not include a parent query, filter, view or access to a form.
  • Automatic: No threshold is defined, allowing executing an SQL script without condition. It returns a number of record and does not include a parent query, filter, view or access to a form.

Filter

Select ok icon.png  Standard alert

Filter that collects the data for the alert and which can be built in assisted mode or in advanced mode.

FilterMode_AssistedAdvanced
  • The filter criteria are only selected among the fields of the parent query (simple mode) and possible additional fields added manually (complete mode).
             Filter assisted mode.png

    • According to the field type, an assistance for the completion of the conditions can be available.
               Example documentation icon EN.png  Delimiters for dates, value lists, tree structures
    • Fields added manually appear under their alias name; if the alias is empty, the field name in the database is displayed.

      Example documentation icon EN.png

      • Alias name: Phone
      • Field name in the database: PHONE_NUMBER
      .
  • Advanced mode
             Filter advanced mode.png

    • The filter is completed as an SQL query which can call any field of the data model.
    • No assistance for the completion is available.

Value to Calculate

         Alert - step 3.png

For information: Current Time (UT): Current Date / Hour displayed in Universal Time (UT). 

Frequency: Frequency for the calculation of the alert. It is taken into account starting from the Next Compute Date. The parameters vary depending on the selected frequency:

  • Every [N] Month / Days / Hours: Enter the desired frequency, expressed in Universal Time;
  • Depends on: Launches the calculation of the alert automatically once the calculation of another alert is finished (Sequencing of tasks). The list proposes all the existing alerts.
     Example documentation icon EN.png Every 3 months, the 30th at 6 pm; Every 15 days at 10 pm; Every 3 hours. 

Next Compute Date (Note: Only if the selected Frequency is different from Depends on option): Date / Hour where the next execution of the calculation for the alert is scheduled.

  • Update: also via the Enable wizard 
  • The date is re-actualized at each execution of the calculation for the alert.

Best Practice icon.png  To initialize the execution of the calculation immediately: enter a date for the first calculation prior to the current date.

Alert Condition (Note: Only for a Standard alert or a Percentage alert): Defines the threshold that will trigger the actions that are related to the alert when it is encountered by the result of the computing, This value can be defined with maximal and minimal values.

 Example documentation icon EN.png How to complete the alert condition to trigger the alert?

  • Alert when there are more than 20 workstations in stock: 20 < Result < ...
  • Alert when there are less than 10 workstations in stock: ... < Result < 10
  • Alert when there are between 5 and 10 open incidents: 5 <= Result <= 10 

Dividend / Divider (Note: Only for a Percentage alert): Alerts allowing to calculate the value of a Percentage alert, by using the following formula for the calculation: 100 * (Dividend / Divider). Note: These alerts habe to be defined previously.

 Example documentation icon EN.png Alert More than 30 % of incidents unsolved; Alert condition = 30 %;  Notification per email to the person in charge of the handling of the incidents, when the value is reached

  • Dividend alert: Number of late incidents = 18
  • Divider alert: Number of open incidents = 45
              --> Calculation = 100 * (18 / 45) = 40 % of the incidents are late ==> the alert is triggered since the alert condition is met. 

Number of Records / Sum / Average (Note: Sum and Average are only proposed for the numerical fields of the parent query): Selection of the measuring unit for the result of the calculation of the alert, expressing respectively:

  • The number of records corresponding to the filter criteria;
     Example documentation icon EN.png  Alert Number of Incidents created this Week
              --> Calculation = 61: Indicating a total of 61 incidents created during the week
  • The sum of values corresponding to the filter criteria;
     Example documentation icon EN.png Unit applied to the field Solution Delay for the alert Total Intervention Time for Incidents with immediate Solution Today
              Situation of the incidents of the day: 4 with immediate solution with an intervention time of 10 minutes; 1 with an intervention time of 30 minutes
              --> Calculation = (4 * 10 minutes) + (1 * 30 minutes) = 70: Indicating a total intervention time of 70 minutes
  • The average of values corresponding to the filter criteria.
     Example documentation icon EN.png Unit applied to the field Late for the alert Average delay for closed Incidents Today
              Situation of the incidents of the day: 4 solved being late by 1 hour; 1 solved being late by 5 hours; 1 solved being late by 3 hours
              --> Calculation = [(4 * 1h) + (1 * 5h) + (1 * 3h)] / 6 incidents = 2: Indicating a 2 hours delay on average for an incident

Best Practice icon.png  To test the alert and to verify the coherency of the result of the calculation: click on [ CALCULATE ].

Alert

         Alert - step 4.png

To / (Recipients / Employees / Groups): List of recipients to notify via email when the alert reaches its trigger value. It can be employees and/or groups of employees or users defined by the use of system roles or customized roles (If roles are used, the users will be searched at the moment the alert is generated).

  • Click on Roles-Tags window icon.png and select the list of the employees from the data entry help window. You may also enter the names of the recipients into each area; Separate them by a semicolon.
  • Do not forget to define the view associated to the alert if you define employees or roles.

Title: On the notification email sent to the recipients, subject of the alert. By default, it is the name of the alert.

Message: Text of the notification email. 

SQL Script : Script describing the actions to execute on the database when the alert meets the alert condition.

Topic / Description related to the incident or request to create: When the action triggers an automatic creation of an incident/request, subject/description that will be attached automatically. 

Description of the incident or request to create: When the action triggers an automatic creation of an incident / request, description that will be attached automatically. 

[ ADD VIEW ] (Note: Only for a Standard alert): Associates a view to the alert: The users (employees / groups) will receive an email with a direct link to it. 

  • No mail is sent if you do not define a view.
  • Users defined by the use of a role will not receive the direct link.
  • If the recipients do not own the access right to the module to which is associated the view, they cannot visualize it.

Procedures and Wizards

How to create an alert and to implement it

1. Proceed to the page Administration  >  Alerts > Scheduled Alerts and click on Add icon.png.

2. Enter the parameters for the alert by browsing the different steps via [ NEXT ].

  • Step 1:
    • You may add fields to the parent query: click on Edit icon.png related to the field Parent Query (You need to own a profile with the rights to display the module).
    • You may create a new parent query by clicking on Add icon.png (Note: Only if you don't have selected a query).
  • Step 3: Test the calculation for the alert by clicking on [ CALCULATE ].
  • Step 4: If you have defined a notification by email, associate a view by clicking on [ ADD VIEW  ].

3. Save your changes by clicking on [ FINISH ].

4. Enable the new alert:

  • Launch the Enable wizard.
  • Check the presence of the alert in the list of the scheduled tasks.

How to create an alert from a model

1. Proceed to the list of alerts and click on Edit icon.png related to the alert to be used as a model.

2. Enter the name of the new alert and change the desired parameters.

3. In the last wizard step, click on [ SAVE AS ] to avoid overwriting the model.

Wizards

Enable: Activates the alert and starts its calculation by indicating its first computing date. 

Best Practice icon.png

  • To start immediately the calculation of the alert, type a next calculation date that is already over.
  • To verify if the alert is active:
    • Proceed to the page Administration > Scheduled Alerts > List and check the Enabled checkbox is checked.
    • Proceed to the page Administration > Scheduled Tasks > Scheduled Alerts and check the alert appears.

Disable: Stoppes the frequency of calculation of the alert. 

Best Practice icon.png  To verify if the alertis inactive:

  • Proceed to the page Administration > Scheduled Alerts > List and check the Enabled checkbox is unchecked.
  • Proceed to the page Administration > Scheduled Tasks > Scheduled Alerts and check the alert does not appear.

Icon Edit icon.png: Updates the alert.

Icon Delete icon.png: Deletes the alert.

Examples of SQL scripts

Delete Incident

  • Parent query : Incidents
  • Filter: list of Incident number
DELETE sd_request
WHERE  request_id IN ( #list_id# )  

Note : The #LIST_ID# tag returns the IDs of the records defined by the filter. 

Close Incident

  • Parent query: Incidents
  • Filter: List of incident number
UPDATE sd_request
SET    sd_request.status_id = xx
WHERE  sd_request.request_id IN ( #list_id# )

Note: XX is the ID of the new status for the returned record. It can change from one database to the other (Default ID for Closed status is 8.).

Update end date on actions with empty end date within a list of incidents

 

  • Parent query: Incidents
  • Filter: List of incident number
UPDATE am_action
SET    am_action.end_date_ut = Getutcdate()
WHERE  am_action.request_id IN ( #list_id# )
      AND am_action.end_date_ut IS NULL

Note: getUTCDate() returns current date and time.

Tags:
Last modified by Unknown User on 2019/05/29 17:38
Created by Administrator XWiki on 2013/03/25 18:12

Shortcuts

Recent changes
•  Service Engine
•  Service Apps
•  Self Help

Glossary

Powered by XWiki ©, EasyVista 2019