Webhooks
Allure TestOps allows you to send real-time notifications to external applications using webhooks. When a specified event occurs, Allure TestOps can send a POST request to a specified server, including a message with additional information (for example, the number of successfully passed tests in a closed launch).
You can set up a webhook to send messages about new launches and defects to the communication tool your team uses. Or you can send launch data to the external visualization tool for additional analysis.
Allure TestOps supports the following events for webhooks:
- launch creation and closure;
- defect creation, closure, and deletion;
- test plan creation and deletion.
To create a webhook in Allure TestOps, you need to specify the URL of the external server and select one or more events that should trigger notifications.
Creating a webhook
To add a webhook:
Go to Settings → Webhooks.
Click + Webhook.
In the Title field, enter a name for the webhook (for example, the name of the external application).
In the Endpoint field, enter the URL of the external server.
If needed, click + Header to add additional HTTP headers to the request.
Under Events, select the events you need by clicking Trigger and selecting options from the drop-down list.
For example, if you want to send notifications about new launches and defects:
- Click Trigger next to Launches and select Started.
- Click Trigger next to Defects and select Created.
Configure the format of the notification message for each selected event.
The message text can contain variables, which are specified using curly braces:
{{ variableName }}
. When the message is sent, these variables are automatically replaced with the relevant values. For example,{{ projectName }}
will be replaced with the name of the project in which the event was triggered.To add variables to the text, click . To reset the text to the previous state, click .
For launch events, you can additionally set a filter to only receive notifications for specific launches.
Click Test webhook to send a test message to the specified URL.
Click Create to finish creating the webhook.
Message format
By default, Allure TestOps sends webhook messages as JSON objects similar to the following:
{
"text": "Launch at 2024-10-01 22:21 closed by John Doe in the project My Project"
}
When setting up a webhook, you can customize the text of the message, including the set of variables used, or completely change the format as required by the external application.
For example, you can modify the structure of the JSON object:
{
"user": "{{ createdBy }}",
"date": "{{ createdDate }}",
"text": "{{ launchName }} created"
}
Or send messages as plain text, without using JSON:
{{ launchName }} closed by {{ closedBy }}
Below you can find a list of variables that can be used in webhook messages:
Variable | Description |
---|---|
projectName |
Name of the project |
launchName |
Name of the launch |
launchUrl |
Link to the launch in Allure TestOps |
createdDate |
Launch creation date in the format of 2024-12-31 23:59:59 |
createdBy |
User who created the launch |
closedBy |
User who closed the launch or system if the launch was closed automatically |
passedCount |
Number of passed tests |
failedCount |
Number of failed tests |
brokenCount |
Number of broken tests |
skippedCount |
Number of skipped tests |
unknownCount |
Number of tests with unknown status |
Variable | Description |
---|---|
projectName |
Name of the project |
defectName |
Name of the defect |
defectUrl |
Link to the defect in Allure TestOps |
createdBy |
User who created the defect |
closedBy |
User who closed the defect |
deletedBy |
User who deleted the defect |
Variable | Description |
---|---|
projectName |
Name of the project |
testPlanName |
Name of the test plan |
testPlanUrl |
Link to the test plan in Allure TestOps |
testCaseCount |
Number of test cases that make up the test plan |
createdBy |
User who created the test plan |
deletedBy |
User who deleted the test plan |
Filtering launches
When creating a webhook, you can select the launches for the notifications using filters. To do this, enter one or more filter conditions in the Filters field:
Click the Filters field.
Select an attribute by which you want to filter the launches.
Select one or more values for the attribute.
For example, to send notifications only for launches with a specific tag:
- Select Tag.
- Enter a tag.
- Press Enter.
If you enter multiple values, notifications will be sent for launches that have at least one of the specified values.
When several attributes are specified, notifications will only be sent for launches that meet all the conditions.
For example, if you set Firefox as the value for Browser and Windows as the value for OS, notifications will be sent for launches that have both conditions met.