# Xray

> Link Xray tests, test sets, and test plans to their Testsigma counterparts on top of your Jira connection.

Xray integration links Xray artifacts to their Testsigma counterparts: test to test case, test set to test suite, test plan to test plan.

## Prerequisites

- A working [Jira integration](https://testsigma.com/docs/v2/integrations/bug-reporting/jira/).
- Your **Jira Account URL**, plus Xray's **Client ID** and **Client Secret**.

## Connect Xray

1. **Open integrations**: navigate to **Settings > Integrations**.

2. **Enable Xray**: turn on the toggle on the **Xray** widget.

3. **Enter credentials**: in the **Xray Details** dialog, enter the **Jira Account URL**, **Client Id**, and **Client Secret**, then click **Save & Enable**.

You can generate the Client ID and Client Secret in Xray. See Xray's Global Settings: API Keys.

Check **Add Attachments to Test** to include logs, screenshots, and videos of the execution with each test run.

## Link artifacts

Each Xray artifact links to one Testsigma artifact:

| Xray | Testsigma | Where to link |
|---|---|---|
| Test | Test case | Test case details page |
| Test set | Test suite | Test suite details page |
| Test plan | Test plan | Test plan details page |

The Xray ID is the key at the end of the artifact's Jira URL. For `https://testserver.atlassian.net/browse/PT-10`, the ID is **PT-10**.

### Link a test case

Get the ID of the test from Xray. Open the matching test case details page in Testsigma, enter the **Xray ID**, and click **Link Test Case**.

![The Link Test Case dialog, with Xray as the tool and the Xray ID entered](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/update_xray_4.png)

### Link a test set

Get the ID of the test set from Xray (for example, **PT-11**). Open the matching test suite details page, enter the **Xray ID**, and click the link button.

For execution results to flow for every test case inside the suite, each test case must also be linked to its Xray test.

### Link a test plan

Get the ID of the test plan from Xray (for example, **PT-12**). Open the matching test plan details page, enter the **Xray ID**, and click **Link Test Plan**.

When you execute the test plan in Testsigma, the execution status updates for the linked test sets in Xray.
