Link a ticket to a test
Requires the Link tickets permission.
Links an existing ticket from one of your organization’s ticketing connections to a test, 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 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 in another organization is reported as 404, not 403, and so is a malformed id.
Authorizations
An API key, sent as Authorization: Bearer <key>. An organization admin creates one in the Trunk app under Settings → Developer → API Keys and chooses the permissions it holds. A new key starts with no permissions: it can read merge queues but change nothing in them, and it cannot get a Dynamic CI plan. Each endpoint that needs a permission names it in its description; the Dynamic CI plan endpoints need Generate Dynamic CI plans.
Path Parameters
Body
The ticket to link to a test in a test collection.
Response
The linked ticket