Skip to main content
Experience faster, smarter testing with BrowserStack AI Agents. See what your workflow’s been missing. Explore now!
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Bugs API for Low Code Automation

File a bug in Jira or Azure DevOps from a failed Low Code Automation test run.

Use this endpoint to create a ticket in a connected bug tracker and link it to a failed test run. Connect the bug tracker before your first call. For the setup steps, see Jira or Azure DevOps.

For authentication and the base URL, see the Low Code Automation Reference API overview.

Create a bug

Creates a ticket in a connected bug tracker and links it to a test run. This endpoint requires the Update builds role permission.

POST /api/v1/public/projects/{project_id}/builds/{build_id}/test-runs/{test_run_id}/bugs

Request parameters

In the curl request, replace YOUR_USERNAME and YOUR_ACCESS_KEY with your account’s username and access key.

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
  -X POST "https://lcnc-api.browserstack.com/api/v1/public/projects/40906/builds/9a1c77e2b4d0f38561ce0a7f4b21d9903cf8e142/test-runs/f3b90a1157dc4e2b8a06d5391cf7e4488b0a2d67/bugs" \
  -H "accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: build-9a1c77e2-run-f3b90a11" \
  -d '{
    "bug": {
      "integration_key": "jira",
      "project_id": "CHECKOUT",
      "ticket_type_id": "10001",
      "summary": "Login button not clickable on checkout",
      "description": "Step 4 failed on the checkout flow",
      "custom": {
        "priority": "High"
      }
    }
  }'
  • project_id* string

    Unique identifier of the project. Use either the integer Project Key, for example 22530, or the Project ID, for example PR-1. To find both, open your project, click Settings, then General, and look under Project details.

  • build_id* string

    Unique identifier of the build. To get it, open the build, click View metadata, then copy the Build ID.

  • test_run_id* string

    Unique identifier of the test run to attach the ticket to. To get it, call the Get build details endpoint and copy the id of the run from the test_runs array in the response.

  • Idempotency-Key string

    Client-generated identifier for this create request, valid for 24 hours. Retrying with the same key and the same request body returns the original ticket instead of creating a second one, and the response carries an Idempotent-Replayed header. A different key creates a new ticket. The key is bound to its original request body, so reusing it with a different body returns a 400 response.

  • bug* Object

    Details of the ticket to create in the bug tracker.

    β–Ά SHOW VALUES
    • integration_key* string

      Bug tracker to file the ticket in. The possible values are jira and azure.

    • project_id* string

      Project or repository in the bug tracker that the ticket belongs to.

    • ticket_type_id* string

      Issue type to create in the bug tracker.

    • summary* string

      Title of the ticket.

    • description string

      Body of the ticket.

    • assignee string

      Bug tracker user to assign the ticket to.

    • custom Object

      Custom fields specific to your bug tracker. The tracker validates these strictly and returns a 422 response listing each field it rejects.

Response attributes 201 application/json

Response

{
  "bug": {
    "id": "CHECKOUT-42",
    "url": "https://your-org.atlassian.net/browse/CHECKOUT-42"
  },
  "linked": true
}
  • bug Object

    The ticket created in your bug tracker.

    β–Ά SHOW VALUES
    • id String

      Key of the ticket created in your bug tracker, for example CHECKOUT-42.

    • url String

      Link to the ticket.

  • linked Boolean

    Whether the ticket was linked to the test run.

Avoid duplicate tickets on retry

Send an Idempotency-Key header so that a retried request doesn’t file the same bug twice.

Within 24 hours, a retry with the same key and the same request body returns the original ticket instead of creating a second one. The response carries an Idempotent-Replayed header set to true. A different key creates a new ticket.

The key is scoped to a single bug tracker, so sending the same key first to Jira and then to Azure DevOps creates one ticket in each.

Note: Reuse an idempotency key only across retries of the same request. Reusing a key with a different request body returns a 400 response, because the key stays bound to the parameters it was first sent with.

Status codes

The following table lists the responses this endpoint returns:

Code Meaning Cause
201 Created The ticket was created and linked to the test run.
400 Bad request A field is missing or malformed, the bug tracker is unknown, or an Idempotency-Key was reused with a different request body.
401 Unauthorized The credentials are invalid, or the bug tracker isn’t connected.
403 Forbidden Your plan doesn’t include this bug tracker, or your role doesn’t have the Update builds permission. Check error.code: forbidden_plan for the plan, forbidden_rbac for the role.
404 Not found The build or test run doesn’t exist, or it belongs to another group.
409 Conflict A bug creation with this Idempotency-Key is already in progress. Retry with the same key after the first request completes.
422 Unprocessable Your bug tracker rejected the ticket fields.
503 Service unavailable The integration service is unavailable.

Note: A 401 response doesn’t always mean your credentials are wrong. A disconnected bug tracker returns 401 with the code integration_not_connected, and error.details carries setup_completed set to false along with a redirect_uri you can use to connect the integration. Check error.code before you rotate your access key.

A 422 response carries the per-field errors from your bug tracker in error.details, so you can correct the request. For example, a required Jira custom field that is left unset returns 422.

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

Download Copy Check Circle