Creating notifications
The Notifications tab allows you to create notifications. Saved searches are the building blocks for creating notifications. However, you cannot configure a notification on the basis of saved searches shared by other users. If you still want to use saved searches shared by other users, you can clone them and then use the cloned copy to configure a notification.
This topic contains the following information:
Related topics
If a problem occurs
Before you begin
Ensure that the following requirements are met:
- Create the saved searches for which you want to create the notification.
- Ensure that the external configurations or script that you want to use as the notification destination is already created.
Notification creation process overview
While creating a notification, you need to provide information regarding when, how, and where the notification must be sent.
This information can be categorized into the following inputs:
To create a notification
On the Administration > Notifications tab, click Add Notification, provide the following information, and click Create.
- Step 1: Specify notification naming details
- Step 2: Specify the notification type
- Step 3: Specify the scheduling details
- Step 4: Specify the notification destination
Step 1: Specify notification naming details
Under the Notification Details section, provide the following information:
Name: Provide a name to identify this notification.
- Description: (Optional) Provide some additional information for this notification to act as a future reference.By default, this field is automatically populated with the saved search description.
Step 2: Specify the notification type
When you create a notification, by default the notification type is set to Alert.
You can create two types of notifications – an alert and a report. Alerts can be used for logging events on external systems, sending email notifications, and specifying script paths based on which notifications are sent. Reports can be used for sending an email notification and optionally attaching a PDF report containing details about the search string.
The following links provide additional information about the inputs applicable to the notification type selected.
Step 3: Specify the scheduling details
Provide the following inputs to define details regarding the frequency of the notification and the duration for which the notification must be run.The [confluence_table-plus] macro is a standalone macro and it cannot be used inline. Click on this message for details.
Step 4: Specify the notification destination
The notification destination determines the following details:
- Where notification is sent – determined by the notification destination options that you select.
- How the notification is sent – determined by the template used in the notification destination.
For more information, see Notification destination details.
Alert configuration details
You can trigger an alert based on a combination of conditions. To specify conditions, you need to already have saved searches created. Based on these saved searches, you can configure an alert. The search string and the time context of the saved search act as the base for creating the alert. When you configure a notification alert, the saved searches included in the notification are run. If the number of results obtained for that saved search meets the condition added in the notification, an alert is triggered.
You can select multiple saved searches and specify conditions regarding the number of results for each of these saved searches. You can also specify whether all (AND) or either (OR) of the conditions must be met before an alert is triggered.
The following table describes the inputs that you need to specify for configuring an alert.The [confluence_table-plus] macro is a standalone macro and it cannot be used inline. Click on this message for details.
Report configuration details
You can configure a report to send an email notification and optionally attach a PDF report containing details about the search string. An email is sent containing the search string, the result count, and a link that takes you to the specific search context. Furthermore, you can select whether or not to attach a report and include log entries in the report.
The following table describes the inputs that you need to specify for configuring a report.The [confluence_table-plus] macro is a standalone macro and it cannot be used inline. Click on this message for details.
Notification destination details
The notification destination determines the following details:
- Where notification is sent – determined by the notification destination options that you select.
- How the notification is sent – determined by the details (including template) specified after selecting the notification destination.
While creating a notification, you need to perform the following steps:
- Step 1: Select the notification destination option
- Step 2: Specify the notification destination details
Step 1: Select the notification destination option
The notification options selected determines where the notification is sent. This selection depends on the notification type selected – alert or report.
The following table provides information about the notification destination options available for the notification types.
Notification type | Notification destination options |
---|---|
Alert | The following options are available while configuring an alert:
|
Report | While configuring a report, you can select the SMTP server that must be used for sending the email alert. The notification destination name usually starts with "Email". |
The various notification destinations are explained as follows:
Step 2: Specify the notification destination details
After you select the notification destination option, you need to provide some details that determine how the notification must be sent.
These details vary depending on whether you want to configure an alert or report. The details required to configure an alert refer to two kinds of notification destinations – supported external systems and script. The details required to configure an email alert or report are the same. If you specify a script notification destination, then you need to specify the script path. For more information about the script notification destination, see Notification destination options.
The following sections describe the details required for logging an event on an external system and for sending email notifications.
Logging events on external systems
After you select the notification destination for logging events, provide the following details:
Sending email notifications
After selecting the email notification destination, specify the inputs listed in the following table.
Creating templates with custom notifications messages
While configuring an alert or report, you can choose to use the default template or create a new template with custom messages to send notifications. This section does not apply to a script alert.
Depending on the notification destination selected, the following kinds of templates can be created:
- Template for logging events on a supported external system
- Template for sending email notifications
To create a template, select a notification destination, click Create on the left panel, and provide the following details depending on whether you are creating a template for logging an event or sending an email.
While creating a template for logging an event on an external system configured, provide the following details and click Save:
- Name: An appropriate name to identify the template.
You can search by template name on the left panel. - Message: Details of the event that must be displayed on the external system where the event will be logged.
This can contain details such as the saved search name, search string, start and end time when the saved search was run, and so on. You can use default macros while adding such details in the message. These macros are substituted with appropriate values at run time. For more information, see Macros for creating notifications.
To edit a template, after selecting the notification destination, click a template on the left panel, and click Edit. Make your changes and click Save.
To delete a template, after selecting the notification destination, click a template on the left panel, and click Delete.
While creating a template for sending an email, provide the following details and click Save:
- Name: An appropriate name to identify the template.
You can search by template name on the left panel. - Subject: Subject for the email.
- Message: Contents that must appear in the email body.
This can contain details such as the saved search name, search string, start and end time when the saved search was run, and so on. You can use default macros while adding such details in the message. These macros are substituted with appropriate values at run time. For more information, see the following links:
To edit a template, after selecting the notification destination, click a template on the left panel, and click Edit. Make your changes and click Save.
To delete a template, after selecting the notification destination, click a template on the left panel, and click Delete.
Macros for creating notifications
Macros denote objects that can be used to substitute common details specified while creating a notification. For example, saved search name, search string, count of results, and so on. The macros are substituted with appropriate values at run time when the notification is triggered.
You can use macros in the following ways:
- While creating templates, in the Message field while creating templates.
- While creating script notifications, in the script itself.
In the script, macros are passed as environment variables.
If you specified multiple conditions (or multiple saved searches) in the notification, then some macros can take multiple values. For example, the ${QUERYNAME} macro can take multiple values. Macros with multiple values can be accessed as an array. For example, to access the first value of the macro ${QUERYNAME}, you need to specify ${QUERYNAME[0]}. Similarly, to access the second value of this macro, you need to specify ${QUERYNAME[1]}.
To see an example of how macros can be used in the message while sending email notifications, see Example of the template message for sending emails.
The following table provides a list of default macros that can be used in the Message field while creating a template.The [confluence_table-plus] macro is a standalone macro and it cannot be used inline. Click on this message for details.
Example of the template message for sending emails
The following table provides an example of a template message and the actual message used for sending an email notification.The [confluence_table-plus] macro is a standalone macro and it cannot be used inline. Click on this message for details.