---
title: "Link a ticket to a test case"
method: POST
path: "/flaky-tests/link-ticket-to-test-case"
---

# Link a ticket to a test case

`POST /flaky-tests/link-ticket-to-test-case`

## Request body

- object
  - `test_case_id` string, uuid, required — The id of the test case. Should be a UUID.
  - `external_ticket_id` string, required — The external identifier of the ticket. For Jira this is the ticket number prefixed by the Project Key. For Linear this is the ticket number prefixed by the Team Identifier
  - `repo` object, required — The repository to list tests for.
    - `host` string, required — The host of the repository. For example, `github.com` or `gitlab.com`. If self-hosting, this will be the hostname of your instance.
    - `owner` string, required — The owner of the repository. For example, `my-github-org` or `my-gitlab-org/my/sub/group`. `owner` for GitLab will include the GitLab org, plus the project path, but excluding the repo name itself.
    - `name` string, required — The name of the repository.

## Response `200`

OK

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.net/trunk/apis/trunk-apis.md) · [All operations](https://skmtc.net/trunk/apis/trunk-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/trunk/trunk-apis/versions/f7b911d8e24c/schema)
