> ## Documentation Index
> Fetch the complete documentation index at: https://www.bugzy.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Notion

> Connect Notion to give Bugzy access to your product documentation for better test plan generation.

Notion integration enables context ingestion — Bugzy reads your product documentation, feature specs, and requirements from Notion to generate more accurate and comprehensive test plans.

## What Notion enables

* **Context-aware test generation** — Agent reads product specs and requirements when generating test plans
* **Documentation search** — The `documentation-researcher` subagent searches your Notion workspace for relevant context during task execution
* **Living context** — As your Notion docs are updated, subsequent test generation picks up the latest information

## Setup

<Steps>
  <Step title="Navigate to connections">
    Go to **Dashboard > Projects > \[Your Project] > Connections**.
  </Step>

  <Step title="Connect Notion">
    Click **Connect Notion**. This opens the Notion OAuth flow managed by Nango.
  </Step>

  <Step title="Select workspace and pages">
    Choose your Notion workspace. During authorization, select which pages and databases Bugzy can access.
  </Step>

  <Step title="Share relevant content">
    In Notion, share additional pages or databases with the Bugzy integration as needed. The integration can only access content explicitly shared with it.
  </Step>
</Steps>

<Warning>
  Notion integrations can only access pages and databases that have been explicitly shared with them. If Bugzy cannot find your documentation, verify that the relevant pages are shared with the Bugzy integration in Notion.
</Warning>

## What to share

Share the Notion pages that contain information useful for test generation:

| Content type         | Why it helps                                                          |
| -------------------- | --------------------------------------------------------------------- |
| Product specs        | Agent understands expected behavior and generates accurate assertions |
| Feature requirements | Test plans cover all specified acceptance criteria                    |
| User stories         | Agent creates test cases that follow real user flows                  |
| API documentation    | Agent generates tests that verify API contracts                       |
| Release notes        | Agent focuses test generation on recently changed areas               |

**Tip:** Share a top-level parent page to automatically grant access to all child pages beneath it.

## How it works

When Bugzy runs a test generation task:

1. The `documentation-researcher` subagent activates
2. It searches connected Notion pages and databases for content related to the test target
3. Relevant documentation is extracted and provided as context to the test generation task
4. The agent uses this context alongside the application's actual behavior to produce test plans and test cases

Bugzy uses `notion-cli` to search pages, read content, and query Notion databases via the REST API.

## Sharing additional pages

After the initial OAuth flow, you can share more pages with the integration:

1. Open the Notion page or database
2. Click **Share** in the top-right corner
3. Search for your Bugzy integration in the invite field
4. Click the integration to add it, then click **Invite**

## Troubleshooting

**Agent cannot find documentation** — Verify the pages are shared with the Bugzy integration in Notion. Open the page, click Share, and confirm the integration is listed.

**"object\_not\_found" errors** — The target page has not been shared with the integration. Share the page in Notion and retry.

**Stale content** — Notion content is read in real-time during task execution. If you recently updated a page, Bugzy will see the latest version on its next run.

**Connection expired** — Nango handles token refresh automatically. If issues persist, disconnect and reconnect Notion from **Dashboard > Connections**.
