Skip to main content
No Result Found

Variables in webhooks

Learn about variables in webhooks.

You can send variables in the URL and payload of webhooks in Test Observability.

Variables make the webhooks more dynamic. You can configure your receiving application to use variables for processing information. For example, if you are creating a Jira ticket using the webhook, you can pass the test name, build name, error message, etc. in the payload and create the Jira ticket with all these details.

Webhooks offer pre-defined variables depending on the type of trigger. You can send variables enclosed within handlebars in the webhooks body (example - {{BUILD_NAME}}).

List of variables

You can pass default or custom variables along with webhooks. Default variables are automatically populated in the payload template for each event type.

The following are the default variables available:

Variables Sample Value
{{BUILD_NAME}} “wdio-cucumber-samples”
{{BUILD_ORIGINAL_NAME}} “e2e regression”
{{BUILD_STATUS}} “failed”
{{BUILD_DURATION}} 254005
{{BUILD_USER}} “AKIIII”
{{BUILD_TAGS}} “perf,wdio”
{{BUILD_ID}} “81yobvicuiuozd1bncaeegvubey7rbl8naevwets”
{{BUILD_NUMBER}} 235
{{BUILD_STARTED_AT}} “2024-05-08T12:45:34.651+00:00”
{{BUILD_FINISHED_AT}} “2024-05-08T12:49:48.656+00:00”
{{BUILD_TOTAL_PASSED}} 30
{{BUILD_TOTAL_FAILED}} 24
{{BUILD_TOTAL_PENDING}} 0
{{BUILD_TOTAL_SKIPPED}} 8
{{BUILD_TOTAL_UNKNOWN}} 0
{{BUILD_TOTAL_TO_BE_INVESTIGATED}} 24
{{BUILD_TOTAL_AUTOMATION_BUG}} 0
{{BUILD_TOTAL_PRODUCT_BUG}} 0
{{BUILD_TOTAL_NO_DEFECT}} 0
{{BUILD_TOTAL_ENVIRONMENT_ISSUE}} 0
{{BUILD_TOTAL_FLAKY_TESTS}} 6
{{BUILD_TOTAL_ALWAYS_FAILING}} 5
{{BUILD_TOTAL_PERFORMANCE_ANOMALY}} 0
{{BUILD_TOTAL_NEW_FAILURES}} 1
{{BUILD_ALERTS}} “Alert 1: Build duration above 10 secs:CRITICAL, Alert 2:..”
{{UNIQUE_ERRORS_COUNT}} 4
{{UNIQUE_ERRORS_INSIGHT}} “96% failures caused by 3 unique errors”
{{GIT_SHA}} “695155b136e6a6d6db50a4318ff4a39da843f418”
{{GIT_REPO_URL}} “https://github.com/browserstack/test-observability-samplesConnect your Github account”
{{GIT_BRANCH}} “master”
{{GIT_COMMIT_URL}} “https://github.com/browserstack/test-observability-samples/commit/695155b136e6a6d6db50a4318ff4a39da843f418Connect your Github account”
{{CI_JOB_NAME}} “staging-sanity/wdio-cucumber”
{{CI_PLATFORM}} “Jenkins”
{{CI_BUILD_NUMBER}} “4165”
{{CI_BUILD_URL}} “http://localhost:8080/job/staging-sanity/job/wdio-cucumber/4165/”
{{FRAMEWORK_VERSION}} 1.21
{{FRAMEWORK_NAME}} “WebdriverIO-cucumber”
{{SDK_VERSION}} “8.36.1”
{{HOSTNAME}} “EC2AMAZ-658H8P8”
{{HOST_OS}} “Linux”
{{OBSERVABILITY_URL}} “https://observability.browserstack.com/projects/Test+Observability+Samples/builds/wdio-cucumber-samples/235”
{{TOP_ERROR_1}} “AssertionError: assert.fail()”
{{TOP_ERROR_1_IMPACT}} 9
{{TOP_ERROR_2}} “Error: function timed out, ensure the promise resolves within 10000 milliseconds”
{{TOP_ERROR_2_IMPACT}} 7
{{TOP_ERROR_3}} “AssertionError: assert.fail()”
{{TOP_ERROR_3_IMPACT}} 7
{{QG_RESULT}} “passed”
{{QG_PROFILE_ID}} “b7b534ae-8258-4b30-a76d-b4bbac15c74e”
{{QG_PROFILE_1_NAME}} “Browserstack Default Profile”
{{QG_PROFILE_1_TYPE}} “pass if”
{{QG_PROFILE_1_RESULT}} “passed”
{{QG_PROFILE_1_RULE_1_CONDITION}} “Flaky in the overall build is less than 15%”
{{QG_PROFILE_1_RULE_1_VALUE}} 0
{{QG_PROFILE_1_RULE_1_RESULT}} “passed”
{{TEST_TYPE}} “TEST”
{{TEST_NAME}} “Verify Logging - Browserstack Logo Text (1)”
{{TEST_PLATFORM}} Chrome 116, Windows 11
{{TEST_FILE_PATH}} /folder/file.js
{{TEST_STATUS}} “failed”
{{TEST_URL}} “BrowserStack Test Observability”
{{SMART_TAGGED}} [Flaky, New Failure, etc. etc.]
{{IS_AUTO_ANALYZED}} FALSE
{{FAILURE_CATEGORY}}
{{IS_PERFORMANCE_ANOMALY}} FALSE
{{IS_MUTED}} FALSE
{{TEST_TAGS}} [“@browser”]
{{RUN_COUNT}} 1
{{TEST_DURATION}} 191122
{{TEST_FAILURE_LOG}} “Error: Can’t call setValue on element with selector "#username input" because element wasn’t found” (clipped after 100 chars)
{{ALERT_NAME}} “Verify Logging - Browserstack Logo Text (

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle