> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/integrations/qtest-integration/concepts/user-lab-mapping.md).

# User Lab Mapping

User lab mapping links each qTest user to a **lab ID** — the environment identifier SeaLights uses to group test results by testing environment.

## Why It Matters

In SeaLights, a **lab ID** represents a specific testing environment or context. When test executions are reported, SeaLights needs to know which environment each execution came from so it can correctly attribute coverage and generate per-environment Test Optimization recommendations.

Without user lab mapping:

* Test executions from unmapped users are excluded from SeaLights reports
* SeaLights cannot track which environments have been tested
* Test Optimization recommendations may be incomplete or incorrect

## How User IDs Are Discovered

qTest executions include the ID of the user who ran the test. The tool collects these user IDs during report generation and adds any new ones to `config.json` with the placeholder value `TODO-lab-id`:

```json
{
  "userLabMapping": {
    "226846": "lab-east",
    "123456": "TODO-lab-id",
    "789012": "IGNORE"
  }
}
```

You then use `npm run manage-user-mapping` to assign a real lab ID to each `TODO-lab-id` entry.

## Mapping Values

| Value                             | Meaning                                                                             |
| --------------------------------- | ----------------------------------------------------------------------------------- |
| A lab ID string (e.g. `lab-east`) | Executions by this user are reported to SeaLights under this lab                    |
| `TODO-lab-id`                     | Discovered but not yet mapped — assign a lab ID using `npm run manage-user-mapping` |
| `IGNORE`                          | User's executions are excluded from all reports                                     |

## Choosing Lab IDs

* Use your internal environment naming convention consistently across your organization
* Typical examples: `lab-east`, `lab-west`, `qa-1`, `qa-2`, `staging`, `uat`
* Multiple testers can share the same lab ID if they test in the same environment
* The lab ID must match the lab ID configured in the SeaLights coverage collector for the application under test in that environment

## Maintaining Mappings

| Situation                               | Action                                                                                              |
| --------------------------------------- | --------------------------------------------------------------------------------------------------- |
| New tester joins                        | Run a report (they are auto-discovered), then run `npm run manage-user-mapping` to assign their lab |
| Tester moves to a different environment | Edit their mapping in `npm run manage-user-mapping` or directly in `config.json`                    |
| System/bot account appears in results   | Set to `IGNORE`                                                                                     |

See [User Mapping Command](/knowledgebase/setup-and-configuration/integrations/qtest-integration/commands/manage-user-mapping.md) for the interactive tool walkthrough.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/integrations/qtest-integration/concepts/user-lab-mapping.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
