Skip to content

Commit b7fe8b2

Browse files
rdrawardgitbook-bot
authored andcommitted
GITBOOK-766: Linear integration + link to ticket API
1 parent debd8bf commit b7fe8b2

21 files changed

+172
-64
lines changed
-1.24 MB
Loading
-1.1 MB
Loading

.gitbook/assets/jira.png

5.51 KB
Loading
661 KB
Loading
701 KB
Loading
3.52 MB
Loading
3.58 MB
Loading

.gitbook/assets/linear-v2.png

8.12 KB
Loading
3.32 MB
Loading
1.01 MB
Loading

flaky-tests/dashboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ If you have a codeowners file configured in your repos, you will see who owns ea
4848

4949
<figure><picture><source srcset="../.gitbook/assets/details-code-owners-dark.png" media="(prefers-color-scheme: dark)"><img src="../.gitbook/assets/details-code-owners-light (1).png" alt=""></picture><figcaption><p>You can find the code owners of each test on the top right of the test details screen.</p></figcaption></figure>
5050

51-
This information will also be provided when creating a ticket with the [Jira integration](jira-integration.md) or [webhooks](webhooks/).
51+
This information will also be provided when creating a ticket with the [Jira integration](ticketing-integrations/jira-integration.md) or [webhooks](webhooks/).
5252

5353
### **Failure Types**
5454

flaky-tests/get-started/frameworks/pytest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ In your CI job, update your `pytest` command to include the `--junit-xml` and `j
3939
pytest --junit-xml=junit.xml -o junit_family=xunit1
4040
```
4141

42-
The `junit_family=xunit1` is necessary so that the generated XML report includes file paths for each test case. File paths for test cases are used for features that use code owners like the [Jira integration](../../jira-integration.md) and [webhooks](../../webhooks/).
42+
The `junit_family=xunit1` is necessary so that the generated XML report includes file paths for each test case. File paths for test cases are used for features that use code owners like the [Jira integration](../../ticketing-integrations/jira-integration.md) and [webhooks](../../webhooks/).
4343

4444
#### Report File Path
4545

flaky-tests/jira-integration.md

Lines changed: 0 additions & 60 deletions
This file was deleted.

flaky-tests/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ To learn more, [see our docs about quarantining tests](quarantining.md).
6262

6363
Trunk enables the automation of quickly creating and assigning tickets through integrations with platforms like Jira and Linear, as well as custom workflows with webhooks. The status of tickets created will be reflected in real-time in the Trunk web app. This helps you track efforts to fix high-impact, flaky tests.
6464

65-
To learn more, [learn about our ticketing integrations](jira-integration.md).
65+
To learn more, [learn about our ticketing integrations](ticketing-integrations/jira-integration.md).
6666

6767
### **Next Steps**
6868

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
description: >-
3+
Triage your flaky tests faster by creating automatically assigned and labeled
4+
tickets in your ticketing system
5+
---
6+
7+
# Ticketing Integrations
8+
9+
You can integrate directly with your ticketing systems to automatically create tickets when Trunk [detects a broken or flaky test](../detection.md).
10+
11+
### Ticket Content
12+
13+
Flaky Tests automatically generates tickets complete with a title and description. If you’re connected to Linear or Jira, you can also assign default issue types, teams, or assignees.
14+
15+
The ticket description contains the following information:
16+
17+
* Identifier of the test
18+
* Since when has the test been labeled flaky
19+
* The last time this test failed
20+
* The impact when run on PRs
21+
* The impact when run on branches
22+
* Quarantine status
23+
* Most common failure reasons
24+
* Code owners, according to the [CODEOWNERS](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) file in your repository
25+
26+
### Integration Setup
27+
28+
Currently, Ticket Creation supports integrations with Linear and Jira. However, the automatically generated ticket content is formatted in Markdown and can be copied to other platforms like Asana or GitHub issues.
29+
30+
<table data-card-size="large" data-view="cards"><thead><tr><th align="center"></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td align="center"><a data-footnote-ref href="#user-content-fn-1"><strong>Linear</strong></a></td><td><a href="../../.gitbook/assets/linear-v2.png">linear-v2.png</a></td><td><a href="linear-integration.md">linear-integration.md</a></td></tr><tr><td align="center"><strong>Jira</strong></td><td><a href="../../.gitbook/assets/jira.png">jira.png</a></td><td><a href="jira-integration.md">jira-integration.md</a></td></tr></tbody></table>
31+
32+
[^1]:
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
description: >-
3+
Triage your flaky tests faster by creating automatically assigned and labeled
4+
tickets with the Jira integration
5+
---
6+
7+
# Jira Integration
8+
9+
When Trunk Flaky Tests [detects a broken or flaky test](../detection.md), you can create an automatically generated Jira ticket for your team to pick up and fix the test.
10+
11+
Webhook payloads will also contain ticket information when a Jira ticket is created with the integration or when [existing tickets are linked](jira-integration.md#link-existing-tickets-to-tests).
12+
13+
### Connecting to Jira
14+
15+
<figure><picture><source srcset="../../.gitbook/assets/jira-connect-form-dark.png" media="(prefers-color-scheme: dark)"><img src="../../.gitbook/assets/jira-connect-form-light.png" alt=""></picture><figcaption></figcaption></figure>
16+
17+
To connect a Jira Cloud project, navigate to **Settings** -> **Repositories** -> **Ticketing Integration** and select **Jira** as your Ticketing System.
18+
19+
Then complete the form and click Connect to Jira Cloud with the following information.
20+
21+
<table data-full-width="false"><thead><tr><th width="176">Field Name</th><th width="266">Description</th><th>Examples</th></tr></thead><tbody><tr><td>Jira URL</td><td>The URL to your Jira Cloud project.</td><td><code>https://trunk-io.atlassian.net</code></td></tr><tr><td>Project Key</td><td>The project key for your Jira project.</td><td><code>KAN</code></td></tr><tr><td>Email</td><td>The email associated with your Jira API token.</td><td><code>[email protected]</code></td></tr><tr><td>Jira API token</td><td><a href="https://id.atlassian.com/manage-profile/security/api-tokens">Create your Jira API token here.</a></td><td><code>ATATT*****19FNY5Q</code></td></tr><tr><td>Default label(s) for new tickets</td><td>Labels applied to new Jira tickets created through Trunk Flaky Tests</td><td><code>flaky-test, debt</code></td></tr></tbody></table>
22+
23+
After connecting to Jira, you can specify a default issue type for new tickets and a default assignee for new tickets.&#x20;
24+
25+
### Create a New Ticket
26+
27+
You can create a new ticket for any test listed in Trunk Flaky Tests.&#x20;
28+
29+
There are 2 ways to create a new ticket in the Flaky Test dashboard:
30+
31+
* Click on the options menu for any test case on the repo overview dashboard
32+
33+
<figure><picture><source srcset="../../.gitbook/assets/create-ticket-button-dark.png" media="(prefers-color-scheme: dark)"><img src="../../.gitbook/assets/create-ticket-button-light.png" alt=""></picture><figcaption></figcaption></figure>
34+
35+
* Use the Create ticket button in the top left corner of the [test case details](../detection.md#test-case-details) page.
36+
37+
Before you create the ticket, you will have a preview of the title and description.
38+
39+
<figure><picture><source srcset="../../.gitbook/assets/jira-ticket-creation-dark.png" media="(prefers-color-scheme: dark)"><img src="../../.gitbook/assets/jira-ticket-creation-light.png" alt=""></picture><figcaption></figcaption></figure>
40+
41+
#### Create with Jira
42+
43+
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.
44+
45+
#### Link existing tickets to tests
46+
47+
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](../../references/apis/flaky-tests.md#post-flaky-tests-link-ticket-to-test-case).
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
description: >-
3+
Triage your flaky tests faster by creating automatically assigned and labeled
4+
tickets with the Linear integration
5+
---
6+
7+
# Linear Integration
8+
9+
When Trunk Flaky Tests [detects a broken or flaky test](../detection.md), you can create an automatically generated Linear ticket for your team to pick up and fix the test.
10+
11+
Webhook payloads will also contain ticket information when a Jira ticket is created with the integration or when [existing tickets are linked](linear-integration.md#link-existing-tickets-to-tests).
12+
13+
### Connecting to Linear
14+
15+
<figure><picture><source srcset="../../.gitbook/assets/linear-integration-dark.png" media="(prefers-color-scheme: dark)"><img src="../../.gitbook/assets/linear-integration-light.png" alt=""></picture><figcaption></figcaption></figure>
16+
17+
To connect a Linear project:
18+
19+
1. Navigate to **Settings** > **Repositories** > **Ticketing Integration.**
20+
2. Select **Linear** as your Ticketing System.
21+
3. Add a Linear API key
22+
4. Select a Team and **Connect to Linear**.
23+
24+
After connecting to Linear, you can specify a default project and a default assignee for new tickets.&#x20;
25+
26+
### Create a New Ticket
27+
28+
You can create a new ticket for any test listed in Flaky Tests.&#x20;
29+
30+
There are 2 ways to create a new ticket in the Flaky Test dashboard:
31+
32+
* Click on the options menu for any test case on the repo overview dashboard
33+
34+
<figure><picture><source srcset="../../.gitbook/assets/create-ticket-button-dark.png" media="(prefers-color-scheme: dark)"><img src="../../.gitbook/assets/create-ticket-button-light.png" alt=""></picture><figcaption></figcaption></figure>
35+
36+
* Use the Create ticket button in the top left corner of the [test case details](../detection.md#test-case-details) page.
37+
38+
Before you create the ticket, you get a preview of the title and description.
39+
40+
<figure><picture><source srcset="../../.gitbook/assets/jira-ticket-creation-dark.png" media="(prefers-color-scheme: dark)"><img src="../../.gitbook/assets/jira-ticket-creation-light.png" alt=""></picture><figcaption></figcaption></figure>
41+
42+
#### Create with Linear
43+
44+
If you are connected to Linear, you can click the **Create Linear Ticket** button at the end of the modal to automatically create a ticket with the configured team and assignees.
45+
46+
Note: You can use [Flaky Tests webhooks](../webhooks/linear-integration.md) to automate ticket creation, or if you need more control over how tickets are created in Linear. This integration is not required when using webhooks.
47+
48+
#### Link existing tickets to tests
49+
50+
If you already have a ticket in Linear that you want to link to a test in the dashboard, you can use the [Link Ticket to Test Case API](../../references/apis/flaky-tests.md#post-flaky-tests-link-ticket-to-test-case).
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
description: >-
3+
Triage your flaky tests faster by manually creating tickets from generated
4+
markdown
5+
---
6+
7+
# Other Ticketing Platforms
8+
9+
If you have not set up an integration, Trunk Flaky Tests can still generate a ticket title and description so you can copy and paste the details into your project management software.
10+
11+
### Create a New Ticket
12+
13+
You can create a new ticket for any test listed in Trunk Flaky Tests.&#x20;
14+
15+
There are 2 ways to create a new ticket in the Flaky Test dashboard:
16+
17+
* Click on the options menu for any test case on the repo overview dashboard
18+
19+
<figure><picture><source srcset="../../.gitbook/assets/create-ticket-button-dark.png" media="(prefers-color-scheme: dark)"><img src="../../.gitbook/assets/create-ticket-button-light.png" alt=""></picture><figcaption></figcaption></figure>
20+
21+
* Use the Create ticket button in the top left corner of the [test case details](../detection.md#test-case-details) page.
22+
23+
Before you create the ticket, you will have a preview of the title and description.
24+
25+
<figure><picture><source srcset="../../.gitbook/assets/manual-ticket-creation-dark.png" media="(prefers-color-scheme: dark)"><img src="../../.gitbook/assets/manual-ticket-creation-light.png" alt=""></picture><figcaption></figcaption></figure>
26+
27+
Now you can copy and paste the ticket title and description into your project management or ticketing platform.

flaky-tests/webhooks/linear-integration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Trunk allows you to automate Linear Issue creation through webhooks. This will a
1010

1111
This guide will walk you through integrating Trunk Flaky Tests with Linear Issues through webhooks. You will be able to automatically generate Linear issues for **new flaky tests** found in your repo that **impact more than 2 PRs**. This guide should take 15 minutes to complete.
1212

13+
Trunk also has a [built-in Linear integration](linear-integration.md) for ticket creation. You only need to use webhooks if you want to automate ticket creation or need additional customization.
14+
1315
### 1. Create a Linear Personal Access Token
1416

1517
Before you can create a webhook to automate GitHub Issue creation, you need to create an API token to authorize your requests.

references/apis/flaky-tests.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ All requests must be [authenticated](./#authentication) by providing the `x-api-
88
[Broken link](broken-reference)
99
{% endopenapi-operation %}
1010

11+
{% openapi-operation spec="trunk-api" path="/flaky-tests/list-quarantined-tests" method="post" %}
12+
[Broken link](broken-reference)
13+
{% endopenapi-operation %}
14+
15+
{% openapi-operation spec="trunk-api" path="/flaky-tests/link-ticket-to-test-case" method="post" %}
16+
[Broken link](broken-reference)
17+
{% endopenapi-operation %}

summary.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@
6363
* [Flaky Test Detection](flaky-tests/detection.md)
6464
* [Quarantining](flaky-tests/quarantining.md)
6565
* [PR Comments](flaky-tests/github-pull-request-comments.md)
66-
* [Jira Integration](flaky-tests/jira-integration.md)
66+
* [Ticketing Integrations](flaky-tests/ticketing-integrations/README.md)
67+
* [Jira Integration](flaky-tests/ticketing-integrations/jira-integration.md)
68+
* [Linear Integration](flaky-tests/ticketing-integrations/linear-integration.md)
69+
* [Other Ticketing Platforms](flaky-tests/ticketing-integrations/other-ticketing-platforms.md)
6770
* [Webhooks](flaky-tests/webhooks/README.md)
6871
* [Slack Integration](flaky-tests/webhooks/slack-integration.md)
6972
* [Microsoft Teams Integration](flaky-tests/webhooks/microsoft-teams-integration.md)

0 commit comments

Comments
 (0)