# Linking TestRail as a source - Docs

![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_9608fcca70)

![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_dark_a92b0e022d)

Let AI connect your sources for you

Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

`npx @posthog/wizard warehouse`

[Learn more](/wizard.md)

![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)

**Alpha release**

This source is currently in **alpha**. The interface and available tables may change.

The TestRail connector syncs your test management data — projects, test cases, runs, plans, and results — into the PostHog Data warehouse, so you can analyze QA activity and test outcomes alongside your product data.

## Prerequisites

You need a TestRail Cloud account (a `yourcompany.testrail.io` address; self-hosted TestRail Server instances on custom domains aren't supported yet), and the API must be enabled for your instance under **Administration → Site Settings → API**. Any user can create an API key; the connector reads whatever projects that user can see.

## Adding a data source

1.  In PostHog, go to the [Sources tab](https://app.posthog.com/data-management/sources) of the data pipeline section.
2.  Click **\+ New source** and click **Link** next to this source.
3.  Enter your credentials (see [Configuration](#configuration) below) and click **Next**.
4.  Select the tables you want to sync, choose a sync method and frequency, then click **Import**.

Once the syncs are complete, you can start querying this data in PostHog.

When linking TestRail, you'll need:

-   **TestRail address** – the first part of your TestRail Cloud host. For `yourcompany.testrail.io`, enter `yourcompany`.
-   **Email** – the email address of the TestRail account to connect with.
-   **API key** – create one under **My Settings → API keys** in TestRail.

## Sync modes

Each table can be synced in one of several modes, depending on what the source supports:

-   **Webhook** (when available) – the source pushes changes to PostHog in real time. Fastest freshness, lowest ongoing cost, and the only mode that reliably captures updates and deletes.
-   **Incremental** – only new or updated rows are synced on each run, using a cursor field (such as an `updated_at` timestamp). Cheaper than a full refresh, but deletes aren't captured.
-   **Append only** – new rows are appended using a cursor field; existing rows are never updated. Ideal for immutable, append-only tables like event logs.
-   **Full refresh** – the whole table is reloaded on every sync. Use it when a table has no reliable cursor or when you need deletions reflected.

See [sync methods](/docs/cdp/sources.md#sync-methods) for a full explanation of how each mode works and how to choose between them.

The `cases` table supports incremental syncs on `updated_on`, and `runs`, `plans`, and `results` support incremental syncs on `created_on` — TestRail timestamps are UNIX epoch integers. Two caveats worth knowing:

-   Runs and plans have no server-side "updated after" filter, so incremental syncs pick up **new** runs and plans but don't refresh completion state on rows synced earlier. Run a full refresh when you need completion fields (`is_completed`, `completed_on`, pass/fail counts) brought up to date.
-   The `runs` table includes both standalone runs and runs inside test plans. On incremental syncs, plan runs are found through their plan's creation time, so a run added later to an old plan only appears on a full refresh.

## Configuration

| Option | Type | Required |
| --- | --- | --- |
| TestRail address | text | Yes |
| Email | email | Yes |
| API key | password | Yes |

## Supported tables

| Table | Description | Sync method | Incremental field | Primary key |
| --- | --- | --- | --- | --- |
| projects | A project in TestRail — the top-level container for test suites, runs, plans, and milestones. | Full refresh | — | — |
| users | A user account on the TestRail instance. | Full refresh | — | — |
| suites | A test suite — a collection of test cases within a project. | Full refresh | — | — |
| sections | A section grouping test cases within a suite, optionally nested under a parent section. | Full refresh | — | — |
| cases | A test case — the reusable definition of a test, organized into sections and suites. | Incremental, Full refresh | updated_on | — |
| milestones | A milestone within a project, used to group test runs and plans toward a release or date. | Full refresh | — | — |
| runs | A test run — an execution of a set of test cases. Includes standalone runs and runs that belong to a test plan (plan_id is set). | Incremental, Full refresh | created_on | — |
| plans | A test plan — a group of test runs, often spanning multiple suites and configurations. | Incremental, Full refresh | created_on | — |
| tests | A test — the instance of a test case inside a specific test run, carrying its current status. | Full refresh | — | — |
| results | A test result — one status change or outcome recorded against a test. Results are append-only. | Incremental, Full refresh | created_on | — |
| statuses | A test status available on the instance (passed, blocked, retest, failed, plus custom statuses). | Full refresh | — | — |
| priorities | A test case priority available on the instance (e.g. Low, Medium, High, Critical). | Full refresh | — | — |
| case_types | A test case type available on the instance (e.g. Functional, Regression, Automated). | Full refresh | — | — |

## Troubleshooting

-   **"The API is disabled for your installation"** – an administrator needs to enable the API under **Administration → Site Settings → API**.
-   **Authentication errors** – your email or API key is invalid or has been revoked. Create a new key under **My Settings → API keys**, then reconnect.
-   **Missing users** – listing all users requires a TestRail administrator account. For non-administrator accounts the connector lists users per project, which skips users that only have global access.
-   **Rate limits** – TestRail Cloud throttles API traffic. The connector backs off and retries automatically, but very large instances may sync slowly.

If your sync is failing or data looks wrong, see the [Data warehouse troubleshooting guide](/docs/data-warehouse/troubleshooting.md). If that doesn't help, [contact support](https://us.posthog.com/#panel=support%3Asupport%3Adata_warehouse%3A%3Atrue) – we're happy to help.

### Community questions

Ask a question

### Was this page useful?

HelpfulCould be better