When Trunk Flaky Tests detects a flaky test, you can create an automatically generated Jira ticket for your team to pick up and fix the test. Webhook payloads will also contain ticket information when a Jira ticket is created with the integration or when existing tickets are linked.Documentation Index
Fetch the complete documentation index at: https://trunk-4cab4936-mintlify-migrate-docs-changes-1778515731.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Connecting to Jira
To connect a Jira Cloud project, navigate to Settings -> Repositories -> Ticketing Integration and select Jira as your Ticketing System. Then complete the form and click Connect to Jira Cloud with the following information.| Field Name | Description | Examples |
|---|---|---|
| Jira URL | The URL to your Jira Cloud project. | https://trunk-io.atlassian.net |
| Project Key | The project key for your Jira project. | KAN |
| The email associated with your Jira API token. | johndoe@example.com | |
| Jira API token | Create your Jira API token here. | ATATT*****19FNY5Q |
| Default label(s) for new tickets | Labels applied to new Jira tickets created through Trunk Flaky Tests | flaky-test, debt |
API Token permissions
Your Jira user account must have the following project permissions to create a Jira API token that allows Trunk to read, create, and assign tickets automatically:- Create issues
- Assign issues OR Browse users and groups (global permission)
- Browse projects
- If issue-level security is configured, issue-level security permissions must be granted to read issues.
- Required scopes (classic)
read:jira-workwrite:jira-workread:jira-user
- Required scopes (granular):
read:issue:jiraread:issue-meta:jiraread:issue-security-level:jiraread:issue.vote:jiraread:issue.changelog:jiraread:avatar:jiraread:status:jiraread:user:jiraread:field-configuration:jiraread:application-role:jiraread:group:jiraread:issue-type:jiraread:project:jiraread:project.property:jiraread:issue-type-hierarchy:jiraread:project-category:jiraread:project-version:jiraread:project.component:jiraread:permission:jirawrite:issue:jirawrite:comment:jirawrite:comment.property:jirawrite:attachment:jira
Jira tokens cannot last longer than 365 days. Once the token expires, you will need to generate a new API token.
Create a new ticket
You can create a new ticket for any test listed in Trunk Flaky Tests. There are 2 ways to create a new ticket in the Flaky Test dashboard:- Click on the options menu for any test case on the repo overview dashboard
- Use the Create ticket button in the top left corner of the test case details page.
Create with Jira
If you are connected to Jira, you can click the Create Jira Ticket button at the end of the modal, which will automatically create a ticket with the configured labels and assignees.Link existing tickets to tests
If you already have a ticket in Jira that you want to link to a test in the dashboard, you can use the Link Ticket to Test Case API.Custom Fields
Some Jira projects require additional fields beyond the standard fields (summary, description, and issue type) when creating tickets. Trunk supports configuring default values for any Jira field on a per-issue-type basis. Users can also override those defaults when creating a ticket.Configuring custom fields
In the Jira integration settings (Settings -> Repositories -> Ticketing Integration), select an issue type. Trunk fetches all available fields for that issue type from the Jira API and displays inputs for each supported field. For each field, you can:- Set a default value that pre-fills the field when a ticket is created
- Check Require user to fill at creation to leave the field blank in settings and prompt the user to fill it in the create ticket modal instead
| Jira schema | Input type |
|---|---|
string | Text input |
number | Number input |
option | Searchable dropdown |
user | User picker dropdown |
array of string | Chip input (comma or Enter to add values) |
textarea / string with textarea hint | Textarea |
The
reporter field is treated as optional even when Jira marks it as required. Jira automatically assigns the API token owner as reporter if the field is not specified.summary, description, project, issuetype, attachment, issuelinks, parent