> For the complete documentation index, see [llms.txt](https://docs.qyrus.com/device-farm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.qyrus.com/device-farm/ai-session/configure-jira-and-testrail.md).

# Configure Jira and TestRail

Project integrations connect AI Session projects with Jira and TestRail. Jira can be used to raise tickets from reports. TestRail can receive the result of a linked Qyrus test after each run reaches a final state.

## TestRail Prerequisites

Before configuring TestRail, make sure you have:

* A TestRail account with a username and password or API key.
* A TestRail project.
* At least one test case in the project's test suite.
* A test plan in that project.
* A test run inside the plan that includes one or more test cases.
* A Qyrus project containing the test you want to link.

If a test run contains no cases, its case selector in Qyrus will be empty.

## View Project Integrations

1. Open **Projects** in Device Farm.
2. Select the required project.
3. Open the **Integration** tab.

After a configuration is added, the tab displays an integration table with:

* **Name** — the configuration name.
* **Host** — the Jira or TestRail host address.
* **User Email** — the account associated with the configuration.
* **Last Used** — the most recent use of the configuration.
* **Actions** — controls to **Edit** or **Delete** the configuration.

The page also provides **Search configurations or hosts**, **Reset**, and **Add Configuration** controls.

![Integration table](https://2346916530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSZu8cT8D2Zwayrr4I91%2Fuploads%2Fgit-blob-bc1e7f58e52a1ba06a3bbd8adfb6786b81d98bfc%2Fintegration-table.png?alt=media)

## Add a Configuration

1. Select **Add Configuration**.
2. Choose the service you want to connect:
   * **Jira** — raise tickets from test reports.
   * **TestRail** — sync test results and cases with a TestRail project.
3. Select **Continue** to open the service form.

### Jira Configuration

Enter the following values:

* **Configuration name**
* **Host URL**
* **Email**
* **API Token**

Select **Test Connection**, then select **Add Configuration** to save the connection.

<div align="center"><img src="https://2346916530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSZu8cT8D2Zwayrr4I91%2Fuploads%2Fgit-blob-924af7350797940397dfaadc8bcec36df972cd94%2Fjira-form.png?alt=media" alt="Jira configuration form"></div>

### TestRail Configuration

Enter the following values:

* **Configuration name**
* **Host URL**
* **Username / Email**
* **Password / API Key**

1. Select **Get TestRail Projects**.
2. Confirm that the projects are retrieved successfully.
3. Select the TestRail project that contains the required plans and cases.
4. Select **Create Configuration**.

The form displays a **Projects retrieved** confirmation and lists the available TestRail projects for selection. Choose the correct project because the configuration uses it when loading plans, runs, and cases later.

<div align="center"><img src="https://2346916530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSZu8cT8D2Zwayrr4I91%2Fuploads%2Fgit-blob-e593897bd54d8d523e19ecc0e4a1f3a85e35d4f8%2Ftestrail-form.png?alt=media" alt="TestRail configuration form"></div>

> Treat TestRail and Jira passwords, API keys, and tokens as sensitive. Use a dedicated API key where supported and do not include credentials in screenshots or documentation.

## Link a Qyrus Test to a TestRail Case

Link each Qyrus test to one TestRail case once. The link determines where future results are posted.

1. Open the Qyrus test in the project.
2. Open the test's **Integration** tab.
3. Under **Select Service**, choose **TestRail**.
4. Select the TestRail configuration.
5. Select the **Test Plan**.
6. Select the **Test Run**.
7. Select the **TestRail Case**.
8. Select **Link**.

The selectors load from top to bottom: the configuration determines the TestRail project, the plan determines the available runs, and the run determines the available cases. After linking, the test displays its configuration, plan, run, case, and link timestamp.

![Link TestRail case](https://2346916530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSZu8cT8D2Zwayrr4I91%2Fuploads%2Fgit-blob-051592af860c2a75e36d1c3de7b964bfbf122440%2Flink-testrail-case.png?alt=media)

To change the target for a new release or test cycle, use **Relink** and select the new plan, run, and case. Use **Unlink** to remove the association; future runs will no longer sync to TestRail.

## Sync Results After a Run

Run the linked test from its test page or from an AI Session saved as that test. The execution must be tied to the linked test; a standalone session that is not saved as the test does not sync its result.

When the run reaches a final state, Qyrus generates the PDF report and posts the result to the linked TestRail case. The TestRail update includes the execution status, test name, run summary, and a link to the PDF report.

The overall run status determines the TestRail result: a successfully completed run is reported as **Passed**; other final outcomes are reported as **Failed**.

Manual PDF download does not trigger another TestRail update. If a result is missing, confirm that the test still shows **Linked to TestRail**, the run reached a final state, and a PDF report was generated.

![TestRail result](https://2346916530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSZu8cT8D2Zwayrr4I91%2Fuploads%2Fgit-blob-0e45efd2363cc6bfec5f1b753bfd4a627139fb7a%2Ftestrail-result.png?alt=media)

## Troubleshooting

| Symptom                                     | Likely cause                                                                               | Action                                                                          |
| ------------------------------------------- | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
| No test plans found                         | The selected project has no active plans, or the wrong project was selected                | Add a plan in TestRail or edit the configuration and choose the correct project |
| Test Run list is empty                      | The selected plan has no runs                                                              | Add a test run to the plan in TestRail                                          |
| TestRail Cases list is empty                | The selected run contains no cases                                                         | Add cases to the suite and include them in the test run                         |
| Link is disabled                            | One of the configuration, plan, run, or case selectors is empty                            | Complete all four selections                                                    |
| Run finished but no TestRail result appears | The run was not tied to the linked test, did not reach a final state, or had no PDF report | Run the test from its test page and verify the linked-test panel and report     |
| PDF report link no longer opens             | The report link has expired                                                                | Re-run the test to generate a new report link                                   |

> **Note:** Jira ticket creation from a report is documented in [View Session Reports](/device-farm/ai-session/view-session-reports.md).
