Academy Articles

Getting Started with Webhooks in TestMonitor

Written by René Ceelen | Nov 27, 2024 2:55:26 AM

Webhooks are a powerful tool in TestMonitor that enables real-time communication between TestMonitor and external systems. They allow you to automate workflows, trigger actions, and receive instant notifications based on events occurring in TestMonitor.

This Academy Article will walk you through setting up and using webhooks in TestMonitor, providing practical examples along the way.

Whether you're looking to automate updates, set up real-time alerts, or integrate with CI/CD pipelines, webhooks offer a flexible solution for enhancing your testing workflow.

Setting Up Webhooks

To add a webhook in TestMonitor:

  • Go to the Project Settings of the project you wish to set up a webhook with.
  • Navigate to the Integrations section and click "Configure" for Webhooks.
  • Click "Add Webhook" on the top right.
  • Fill out the required fields:

Name: Identify your webhook.
Events: Select the events that should trigger the webhook.
URL: Enter the endpoint URL of your application.
Secret: Set a webhook secret for added security.
Enabled: Toggle the webhook state.

  • Click "Add" to create the webhook.

Note: Each project can have up to five active webhooks, giving you flexibility in managing multiple integrations.

Testing the Webhook

To ensure your webhook is working correctly:

  • Open the webhook detail page.
  • Click the "Test" button in the upper right.
  • Confirm the test request.
  • Check the webhook log for the test outcome.

Successful tests will display a green checkmark, while failed tests allow you to view request and response details for troubleshooting.

Practical Examples

Example 1: Automated Updates

Use webhooks to automatically update project management tools whenever new test results are available. Here is an example of how webhooks can be used to create Trello cards automatically whenever an issue is created in TestMonitor.

Example 2: Real-Time Alerts

Use webhooks to set up notifications in Slack (with a Slack workflow) or Microsoft Teams (with power automate) for completed test runs, ensuring your team stays informed in real-time.

Example 3: CI/CD Integration

Use webhooks to trigger actions in your CI/CD pipeline when certain test events occur, streamlining your development workflow. Here is an example of how webhooks can be implemented with Circle CI.