Skip to main content
POST
Create a ticket for a test

Authorizations

Authorization
string
header
required

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 merge-queue permissions it holds; a key with none can read merge queues but change nothing. Those permissions scope merge queue only: every key can use the Flaky Tests and Dynamic CI endpoints, including their writes, whatever permissions it holds.

Path Parameters

testId
string
required

The test's globally unique id.

Minimum string length: 1
Example:

"bfeebcf4-0000-8000-8000-000000000001"

Body

application/json

The ticket to create for a test in a test collection.

title
string

The ticket's title. Defaults to the one the web app generates, such as [Flaky Test] suite::test_case_name.

Required string length: 1 - 250
Example:

"[Flaky Test] suite::test_case_name"

description
string

The ticket's body, in Markdown. Defaults to the one the web app generates: the test's location, failure rate, owners and most common failure reasons, with a link back to the test in Trunk.

Example:

"See all details on the [Trunk Test Detail page](https://app.trunk.io/acme/flaky-tests/collections/ab12cd34/tests/bfeebcf4-0000-8000-8000-000000000001)"

fields
object

Provider fields to set on the ticket, keyed by the provider's field id (a Jira custom field id, assignee, a Linear project id), in the shape the provider takes. Merged over the default fields saved on the collection's ticketing connection; a field set here wins.

Example:
replaceExisting
boolean

Replace a ticket already linked to the test. When false or absent, a test that has a ticket is refused with TEST_ALREADY_LINKED.

Example:

false

Response

The created and linked ticket

id
string
required

Trunk's id for the linked ticket.

Example:

"5d4c3b2a-1f0e-4a1b-8c9d-0e1f2a3b4c5d"

provider
enum<string>
required

The ticketing system a ticket lives in.

Available options:
jiraCloud,
linear,
asana,
jiraDataCenter
Example:

"jiraCloud"

key
string
required

The provider's human-readable key. Mutable on some providers (a Jira issue moved between projects gets a new one).

Example:

"TRUNK-1234"

url
string<uri>
required
Example:

"https://acme.atlassian.net/browse/TRUNK-1234"

title
string
required
Example:

"[Flaky Test] suite::test_case_name"

status
string
required

The provider's status name, as last synced.

Example:

"In Progress"

assignee
string | null
required

The provider's assignee display name; null when unassigned.

Example:

"Ada Lovelace"

syncedAt
string<date-time>
required

When Trunk last read the ticket back from its provider.

Example:

"2026-09-15T14:45:01.000Z"