# Linear

The Linear integration connects Interlynk to your Linear workspace for vulnerability ticket creation and tracking.

***

## Purpose

* Create Linear issues for vulnerabilities discovered in SBOMs.
* Track remediation progress from within your existing Linear workflow.

## Setup Steps

1. Navigate to **Settings > Organization > Integrations**.
2. Click **Linear**.
3. Enter the following:
   * **Linear Host URL**: Pre-filled with the Linear API URL (not editable).
   * **API Token**: A Linear personal API key. Generate one from **Linear > Settings > API > Personal API keys**.
4. Click **Verify** to test the connection.
5. On success, the verification panel displays: account name, email, and account ID.
6. Click **Save**.

## Configuration

After connecting Linear, configure per-product settings in **Settings > Organization > Ticketing**:

* **Provider**: Select Linear.
* **Project Key**: Map to a Linear project.
* **Issue Type**: Select the issue type for vulnerability tickets.

## Required Permissions

### Linear API Key Permissions

The API key should have access to:

| Scope         | Purpose                             |
| ------------- | ----------------------------------- |
| Read projects | List available projects for mapping |
| Create issues | Create vulnerability tickets        |
| Read issues   | Track ticket status                 |

### Interlynk Permissions

| Permission           | Purpose                          |
| -------------------- | -------------------------------- |
| `view_connections`   | View Linear integration settings |
| `edit_connections`   | Configure Linear connection      |
| `delete_connections` | Remove the Linear integration    |

## Security Notes

* The Linear API token is encrypted at rest.
* Use a **service account** API key if available, rather than a personal key tied to an individual.
* Rotate the API key periodically and update the integration configuration.

## Troubleshooting

| Issue               | Cause                                      | Resolution                                  |
| ------------------- | ------------------------------------------ | ------------------------------------------- |
| Verification fails  | Invalid API token                          | Generate a new API key from Linear settings |
| Cannot see projects | Token lacks project read access            | Verify the API key has the correct scopes   |
| Tickets not created | Product not configured with Linear project | Set the project key in ticketing settings   |
