Skip to main content

Prerequisites

The connector should already be set up, with a Connector Profile and a Linked Account. See Getting Started on the BrowserStack connector page.

Get the Native Webhook URL

The Native Webhook URL is shown in StackOne Hub when you link the account. Both Percy and BrowserStack platform webhooks send events to this URL.

  • Open the account linking form in StackOne Hub.
  • Copy the value from Native Webhook URL.

Percy project webhooks

Percy webhooks are set per project and send a fixed payload, so no body needs to be written. Repeat these steps for each Percy project you want events from.

1

Add the webhook

Sign in to Percy and open the project.

  • Click Integrations.
  • Under Web Hooks, click Add Webhook.
  • URL: the Native Webhook URL from StackOne
Percy Edit webhook form with the URL field highlighted
2

Subscribe to events

Under Subscribed events (choose at least one), select the events to send to StackOne.

  • Select ping.
  • Select build_created.
  • Select build_approved.
  • Select build_finished.
  • Select build_changes_requested.
  • Select build_unreviewed.
  • Click Create webhook.
  • Percy sends a ping event when the webhook is created or updated.
Percy Subscribed events list with the six supported events and the Create webhook button highlighted

BrowserStack platform webhooks

Test Management and Test Reporting & Analytics webhooks send a body you write yourself, so each webhook covers one event and its body tells StackOne which event it is. Create one webhook for each event you want.

1

Choose the event

Sign in to BrowserStack Test Management and open Settings.

  • Under TM Global Settings, click Webhooks.
  • Click Create webhook.
  • Webhook Name: a name that identifies the event, for example StackOne test case created
  • Projects: the projects to send events for
  • Event Type: the event, for example Test Case
  • Trigger condition: the action, for example Create
  • Test Reporting & Analytics: Sign in to Test Reporting & Analytics, open Settings > Webhooks and click Create webhook. Its Event Type options are Build Finish, Test Failure, Quality Gate Result and Alert Trigger.
BrowserStack Create Webhook form with the Webhook Name, Event Type and Trigger condition highlighted
2

Set the payload URL

Scroll to Payload in the same form.

  • Click Custom.
  • Method: POST
  • URL: the Native Webhook URL from StackOne
BrowserStack payload settings with Custom and the URL field highlighted
3

Add the body

In the Body tab, write a JSON body. Two fields are required, and you can add any other fields you want after them.

  • event_type (required): the event key for this webhook, such as build_finish, test_failure, quality_gate_result, alert_triggered, test_case_created, test_case_updated, test_case_deleted, test_case_archived, test_plan_created, test_plan_updated, test_plan_completed, test_plan_deleted or test_result_added
  • record_id (required): {{BUILD_ID}} for Test Reporting & Analytics events, {{TC_ID}} for test cases, {{TP_ID}} for test plans and {{TEST_NAME}} for test results
  • occurred_at (optional): a timestamp variable when the event has one, such as {{BUILD_FINISHED_AT}}
  • Any other fields (optional): add BrowserStack variables from Variables, for example under details
  • Click Create.
BrowserStack payload body editor with an example body containing event_type and record_id

Verify

Your Connector should now be able to receive and process events. Try triggering an event and you should see an Event appear in the Connector logs.