Jira Integration

Triage your flaky tests faster by creating automatically assigned and labeled tickets with the Jira integration

When Trunk Flaky Tests detects a broken or 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.

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

Email

The email associated with your Jira API token.

Default label(s) for new tickets

Labels applied to new Jira tickets created through Trunk Flaky Tests

flaky-test, debt

After connecting to Jira, you can specify a default issue type for new tickets and a default assignee for new tickets.

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.

You need to create an API token with the following scopes:

  • Required scopes (classic)

    • read:jira-work

    • write:jira-work

    • read:jira-user

  • Required scopes (granular):

    • read:issue:jira

    • read:issue-meta:jira

    • read:issue-security-level:jira

    • read:issue.vote:jira

    • read:issue.changelog:jira

    • read:avatar:jira

    • read:status:jira

    • read:user:jira

    • read:field-configuration:jira

    • read:application-role:jira

    • read:group:jira

    • read:issue-type:jira

    • read:project:jira

    • read:project.property:jira

    • read:issue-type-hierarchy:jira

    • read:project-category:jira

    • read:project-version:jira

    • read:project.component:jira

    • read:permission:jira

    • write:issue:jira

    • write:comment:jira

    • write:comment.property:jira

    • write: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

Before you create the ticket, you will have a preview of the title and description.

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.

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.

Last updated