Link a ticket to a test case
Links an existing ticket from one of your organization’s ticketing connections to a test case, and returns the ticket as Trunk now holds it. The ticket is fetched from its provider first, so a key or URL the provider does not recognize is refused.
A test case carries at most one ticket. Linking replaces any ticket already linked; linking the one already there changes nothing. Which connection is used is integrationId, defaulting to the collection’s default connection — with no default and no integrationId, the call is refused with TICKETING_NOT_CONFIGURED.
The call round-trips to the ticketing provider twice (to validate the connection, then to fetch the ticket) and answers 504 if that takes longer than five seconds. A 504 does not mean the link failed — retry it; re-linking the same ticket is a no-op. A 502 UPSTREAM_ERROR means the provider did not answer; when it was rate-limiting, Retry-After says how long to wait.
A test case in another organization is reported as 404, not 403, and so is a malformed id.
Authorizations
An org-scoped API key, sent as Authorization: Bearer <key>. Existing v1 tokens work here unchanged. There is no enqueue-only or read/write scope: an org key authorized for merge-queue writes can invoke every merge-queue mutation, including changing merge-protection configuration and pausing, draining or deleting a queue.
Path Parameters
The test case's globally unique id.
1"bfeebcf4-0000-8000-8000-000000000001"
Body
The ticket to link to a test case in a test collection.
The ticket to link, as its provider key (TRUNK-123, a Linear identifier, an Asana task gid) or as its browser URL — either form is accepted.
1 - 2048"TRUNK-1234"
Which of the organization's ticketing connections the ticket lives on. Defaults to the collection's default connection.
"2b3c4d5e-6f70-4a1b-8c9d-0e1f2a3b4c5d"
Response
The linked ticket
Trunk's id for the linked ticket.
"5d4c3b2a-1f0e-4a1b-8c9d-0e1f2a3b4c5d"
The ticketing system a ticket lives in.
jiraCloud, linear, asana "jiraCloud"
The provider's human-readable key. Mutable on some providers (a Jira issue moved between projects gets a new one).
"TRUNK-1234"
"https://acme.atlassian.net/browse/TRUNK-1234"
"[Flaky Test] suite::test_case_name"
The provider's status name, as last synced.
"In Progress"
The provider's assignee display name; null when unassigned.
"Ada Lovelace"
When Trunk last read the ticket back from its provider.
"2026-09-15T14:45:01.000Z"