Webhooks

Webhooks are user-defined POST callbacks that allow you to receive notifications as soon as certain events occur. For example, webhooks can be defined in qTest to notify you when an internal Defect is submitted. Webhooks provide you with immediate notifications when events happen, rather than having to wait until qTest periodically polls for changes. In addition, webhooks in qTest support both HTTP and HTTPS, based on the registered URL.

For example, suppose you have ordered a cake and are waiting to pick the cake up from the bakery. Rather than calling the bakery multiple times and asking whether the cake is ready, similar to polling, you can think of a webhook as a notification system that will give you a call as soon as the cake is finished.

Webhooks in qTest are configured and managed using APIs. Using the APIs, you can register a new webhook, view a list of all registered webhooks, modify an existing webhook, and delete a webhook.

To manage webhooks, you must have the Manage Webhooks permission.

Register a new webhook

To receive notifications from a webhook, the webhook must be registered. To register a new webhook using an API:

  • POST /api/v3/webhooks

When you register a webhook, you can also specify a Secret Key, which can be used to authenticate the payload received from a webhook. When a Secret Key is set for a webhook, qTest creates a hash signature with each payload that is passed along with each event in the header: "x-qTest-signature". A returned payload should include the Secret Key in the header if the payload is valid.

View a list of registered webhooks

To view a list of all registered webhooks using an API:

  • GET /api/v3/webhooks

Modify a webhook

To modify a webhook using an API:

  • PUT /api/v3/webhooks/<webhook ID>

Delete a webhook

To delete a webhook using an API:

  • DELETE /api/v3/webhooks/<webhook ID>

Available webhook events

Following are the available webhook events, listed by object type. You can also view a list of all supported webhook events using the following API:

  • GET /api/v3/webhooks/events

Defects

Event Notification Sample payload
defect_modified A defect is updated in qTest
Copy
{
 "event_timestamp": <timestamp>,
 "event_type": defect_modified,
 "defect": {
     "id":2882170,
     "project_id":319416}
}
defect_submited

A new internal defect is submitted in qTest

Note: If an external defect tracking integration is enabled, this event is disabled.

Copy
{
 "event_timestamp": <timestamp>,
 "event_type": defect_submitted,
 "defect": {
     "id":2882170,
     "project_id":319416}

Projects

Event Notification Sample payload
project_created A new project is created in qTest
Copy
{
 "event_timestamp": <timestamp>,
 "event_type": project_created,
 "project": {
     "id":2882170}
project_updated A project is updated in qTest
Copy
{
 "event_timestamp": <timestamp>,
 "event_type": project_updated,
 "project": {
     "id":2882170}

Test cases

Event Notification Sample payload
testcase_created A new test case is created in qTest
Copy
{
 "event_timestamp": <timestamp>,
 "event_type": testcase_created ,
 "testcase": {
     "id":2882170,
     "project_id":319416}
}
testcase_deleted A test case is deleted in qTest
Copy
{
 "event_timestamp": <timestamp>,
 "event_type": testcase_deleted,
 "testcase": {
     "id":2882170,
     "project_id":319416}
testcase_updated

A test case is updated in qTest, including:

  • Test case property changes

  • Test case approvals from qTest or Vera

  • Test step additions, updates, or deletions

  • Conversion of test case type (manual or automatic)

Copy
{
 "event_timestamp": <timestamp>,
 "event_type": testcase_updated ,
 "testcase": {
     "id":2882170,
     "project_id":319416,
     "testcase_version":"1.0",
     "testcase_versionid":38678568}
}

Test logs

Event Notification Sample payload
testlog_modified A test log is updated in qTest
Copy
{
 "event_timestamp": <timestamp>,
 "event_type": testlog_updated,
 "testlog": {
      "id":73177688,
      "project_id":319416,
      "testrun_id":64971811}
}
testlog_submitted A new test log, either manual or automation, is submitted in qTest
Copy
{
 "event_timestamp": <timestamp>,
 "event_type": testlog_submitted,
 "testlog": {
      "id":73177688,
      "project_id":319416,
      "testrun_id":64971811}
}

Test runs

Event Notification Sample payload
testrun_created A new test run is created in qTest
Copy
{
 "event_timestamp": <timestamp>,
 "event_type": testrun_created,
 "testrun": {
     "id":2882170,
     "project_id":319416}
}
testrun_deleted A test run is deleted in qTest
Copy
{
 "event_timestamp": <timestamp>,
 "event_type": testrun_deleted,
 "testrun": {
     "id":2882170,
     "project_id":319416}
testrun_updated A test run is updated in qTest
Copy
{
 "event_timestamp": <timestamp>,
 "event_type": testrun_updated,
 "testrun": {
     "id":2882170,
     "project_id":319416}
}

Requirements

Event Notification Sample payload
requirement_created A new requirement is created in qTest
Copy
{
 "event_timestamp": <timestamp>,
 "event_type": requirement_created,
 "requirement": {
     <related info here> }
}
requirement_deleted A requirement is deleted in qTest
Copy
{
 "event_timestamp": <timestamp>,
 "event_type": requirement_deleted,
 "requirement": {
     <related info here> }
}
requirement_updated A requirement is updated in qTest
Copy
{
 "event_timestamp": <timestamp>,
 "event_type": requirement_updated,
 "requirement": {
     <related info here> }
}