> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://docs.brainframe.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Confluence integration

> **"Bring team knowledge into your GRC workspace — browse, create and edit Confluence pages from Brainframe, and import them as live documents in your folders."**
> *Connect your Atlassian Confluence Cloud site, search pages across spaces, and pull policies, runbooks and evidence into Brainframe without copy-pasting.*

The Confluence integration connects Brainframe to **Confluence Cloud** through the **Confluence REST API v2** (API token authentication). Once configured, you can manage pages from the integrations area — and **import Confluence pages as Brainframe documents** so they stay linked to the source page and can be viewed and edited in context.

Confluence is classified as a **Documents** integration (alongside **SharePoint** and similar connectors), not a **Tasks** integration. You add Confluence content from folder and table views; the document **bolt (⚡) menu** is reserved for **task** integrations (JIRA, Asana, Monday.com, Azure DevOps, etc.).

---

## 1️⃣ Before You Begin

To configure the integration you will need:

* 🛠 A **Brainframe account** with permission to save credentials (see [Credential scope](#credential-scope) below).
* 🔐 An **Atlassian account** with access to the Confluence Cloud site on your domain (e.g. `yourcompany.atlassian.net`).
* 🎫 An **API token** for that account at [Atlassian API tokens](https://id.atlassian.com/manage-profile/security/api-tokens).
* 📂 Sufficient **Confluence permissions** to view, create and edit pages in the spaces you expect to use.

> || ⚠️ Brainframe targets **Confluence Cloud** (``` *.``atlassian.net ``` with `/wiki` REST paths). Self-hosted Server/Data Center sites are not supported by the current integration model.

> 💡 If you already use the **JIRA** integration on the same Atlassian site, you can reuse the **same domain, email and API token** — but you must save a separate **Confluence** credential entry in Brainframe (each integration type has its own configuration).

---

## 2️⃣ Configure the Integration

### Step 1 — Create an API token in Atlassian

1. Log in to your Atlassian account.
2. Open [Atlassian API tokens](https://id.atlassian.com/manage-profile/security/api-tokens).
3. Click **Create API token**, give it a label (e.g. `Brainframe GRC – Confluence`), and copy the token immediately.
4. Note the **email address** of the Atlassian account that owns the token.

> 📌 The token inherits that user’s Confluence space permissions. For workspace-wide access, use a service account with access to the relevant spaces.

### Step 2 — Enter credentials in Brainframe

Go to **Workspace Settings → Integrations → Confluence → Configure** (`/integrations/confluence/config`).

Fill in:

| Field | Description |
| ---- |
| **Confluence domain** | Your site hostname, e.g. `acme.atlassian.net` (with or without `https://`). Stored exactly as entered. |
| **Email** | The Atlassian account email that owns the API token. |
| **API token** | The token you created. Encrypted at rest; never returned to the browser after saving. |

Then click **Save configuration**. Brainframe validates the credentials against the Confluence API before storing them.

> 📌 If no credentials exist yet, opening **Confluence Pages** redirects you to this configuration page automatically.

### Credential scope

| Scope | Who can configure | Who can use |
| ---- |
| **Individual** | Any user | Only that user (their own token) |
| **Workspace** | Workspace administrators only | Everyone in the workspace (token stays on the server) |

**Individual credentials take priority** over workspace credentials when both exist for the same user.

### Legacy workspace credentials

Older workspaces may still have **legacy** Confluence credentials from the previous `auth/addIntegration` flow (domain, email, token stored as `CONFLUENCE`).

* If only legacy credentials exist, Brainframe uses them automatically.
* The configuration page shows a **Legacy Confluence credentials detected** notice when this applies.
* Saving new encrypted credentials **replaces** the legacy row.

To remove legacy credentials without adding new ones, use **Delete legacy configuration** on the config page (admin).

---

## 3️⃣ Using the Confluence Integration Page

Open **Workspace Settings → Integrations → Confluence** (or the Integrations sidebar menu when Confluence is enabled).

The **gear** icon opens credential configuration. **New page** opens the create form.

### 🔎 Search and filters

| Control | Behaviour |
| ---- |
| **Search** | Filters pages by **title** (press Enter or click search). |
| **Space** | Restrict to one Confluence space, or *All spaces*. |
| **Status** | **Current** (default) or **Archived** pages. |
| **Clear** | Resets all filters. |
| **Refresh** | Reloads the current result set. |

Results are paginated (**Load more**, 25 pages per request). The header shows **Showing X pages**.

### 📊 Page table

| Column | Content |
| ---- |
| **Title** | Page name — click the row to open in Brainframe. |
| **Space** | Confluence space name. |
| **Status** | e.g. `current` or `archived`. |
| **Author** | Page author (when returned by the API). |
| **Last updated** | Last modification date. |
| **↗** | **Open in Confluence** — opens the page in Atlassian in a new tab. |

### ➕ Create, view, edit and delete

| Action | Where |
| ---- |
| **Create** | **New page** on the integration page, or **New page** inside the integrations browser dialog. |
| **View** | Click a table row, or open an imported Brainframe document linked to `/integrations/confluence/view/{pageId}`. |
| **Edit** | **Edit** on the page detail screen — change title and body (markdown editor). |
| **Delete** | **Delete** on the page detail screen — permanently removes the page in Confluence. |

**Create / edit fields**

| Field | Required | Notes |
| ---- |
| **Space** | Yes (create) | Target Confluence space. |
| **Title** | Yes | Page title; also used as the Brainframe document title when imported. |
| **Body** | No | Markdown content; converted for Confluence storage. |

Imported documents show page content as **HTML** in view mode (sanitized) and support **markdown editing** in edit mode, using the same editor component as JIRA descriptions.

---

## 4️⃣ Document Integrations — Importing Pages into Folders

Confluence pages enter your GRC workspace primarily through **import**, not through the document bolt menu.

### **Add from integrations** (folder NEW menu)

In any folder, open the **NEW** menu (plus button):

1. Choose **Add from integrations** (cloud icon).
2. The integrations browser opens in **import** mode.
3. Filter by **Documents** (optional) or pick **Confluence** from the catalog.
4. Search for pages, or click **New page** to create one in Confluence first.
5. Click **Import** on a row, or select multiple pages and use **bulk import**.
6. Choose the target folder and document type in the folder selection step.

The imported document points to the live Confluence page. Opening it shows the **inline Confluence viewer** inside the Brainframe editor — title, metadata, body, **Edit**, **Open in Confluence**, and **Delete** (which removes the page in Confluence and can archive the Brainframe document).

### **Add from integrations** (table view)

In a **table view** toolbar, click the **cloud** button:

* Tooltip: **Add from integrations**
* Same import browser as the folder NEW menu.
* Pre-selects the **current table’s document type** when you pick a folder/type for import.

Use this to build a table of linked Confluence policies, procedures, meeting notes, or evidence pages alongside native Brainframe documents.

### Inside the Confluence browse step

| Action | Import mode |
| ---- |
| **Search** | Find pages by title; filter by space. |
| **Import** | Per-row button; bulk toolbar with checkboxes for multi-select. |
| **Open** | Opens the page in Confluence (new tab). |
| **New page** | Creates in Confluence, then imports automatically. |
| **Configure** *(admin)* | Shortcut to credential settings if not configured. |

> 📌 **Import** creates a **new document in the folder you choose**. It does not automatically link the page as a sub-task under another open document. For task-style linking, use a **Tasks** integration (JIRA, Asana, …) from the document **bolt → Task from integrations** menu instead.

---

## 5️⃣ Document Bolt Menu — What Confluence Does *Not* Do

The document header **bolt (⚡) menu** includes **Task from integrations**, which opens the browser filtered to **Tasks** integrations only:

* JIRA, Asana, Monday.com, Azure DevOps, SolarWinds Service Desk, …

**Confluence is not listed there** — it is a **Documents** integration. To add Confluence content while working on a document, import the page into a folder (section 4) and **link** it to your GRC record using normal Brainframe **Link to other document** flows if needed.

Other bolt menu items (unchanged):

| Menu item | Purpose |
| ---- |
| **Create task in Brainframe** | Native Brainframe task in Activities. |
| **Request document review** | Document review workflow. |
| **Record that the actions…** *(tracker docs)* | Daily tracker completion. |

---

## 6️⃣ Inline View on Imported Documents

When a Brainframe document is tied to Confluence:

* The editor area renders **Confluence Inline View** instead of a static HTML snapshot.
* Content is **loaded live** from Confluence on each view.
* **Edit** updates title and body in Confluence; changes appear on refresh.
* **View in Confluence** / **Open in Confluence** opens the canonical page in Atlassian.
* **Delete** removes the page in Confluence; the Brainframe document can be archived.

This replaces the older legacy model that imported a one-time HTML snapshot with an embedded “Open in Confluence” button.

---

## 7️⃣ Sidebar Integrations Menu

When Confluence is **configured and enabled** for your user/group, it appears under **Integrations** in the sidebar (among enabled integrations).

* Opens `/integrations/confluence` — the page browser described in section 3.
* Greyed-out entries mean the integration is visible in menu configuration but **not enabled** or **not accessible** — ask an administrator to enable it under **Workspace Settings → Menu interface**.

---

## 8️⃣ Permissions Summary

| Action | Requirement |
| ---- |
| Save **workspace** Confluence credentials | Workspace administrator |
| Save **individual** Confluence credentials | Any authenticated user |
| Browse / create / edit / delete pages | Valid credentials + Confluence space permissions for the API user |
| **Add from integrations** (import) | Write access to target folder |
| Integrations sidebar menu item | Integration enabled in menu config + catalog status **available** + user/group access |

> 📌 All Confluence API calls are proxied through the Brainframe backend. Tokens are never exposed to the browser after save.

---

## 9️⃣ Tips for GRC Use Cases

| Scenario | Suggested approach |
| ---- |
| **Import a policy from Confluence** | Folder NEW → **Add from integrations** → Confluence → Import → choose Policy document type. |
| **Maintain a table of linked procedures** | Table view → cloud button → import Confluence pages into that folder/table. |
| **Edit a linked page without leaving Brainframe** | Open the imported document → **Edit** → save (updates Confluence). |
| **Archive obsolete wiki content** | Open inline view → **Delete** (removes in Confluence; archive Brainframe doc if prompted). |
| **Same Atlassian tenant as JIRA** | Configure both integrations with the same domain/token; manage issues in JIRA and pages in Confluence separately. |
| **Find old archived pages** | Integration page or import browser → set **Status** filter to **Archived**. |

---

## 🔟 Troubleshooting

| Symptom | Likely cause | What to do |
| ---- |
| Redirected to **Configure Confluence** | No credentials for your user/workspace | Save individual or workspace credentials; or confirm legacy integration exists. |
| **Failed to load Confluence pages** | Invalid token, wrong domain/email, or revoked token | Regenerate API token; re-save configuration. |
| Empty page list | No pages in selected space, or wrong status filter | Try *All spaces* and **Current** status; confirm pages exist in Confluence. |
| Cannot create page in a space | API user lacks create permission in that space | Grant appropriate space permissions in Confluence. |
| Body looks incomplete in Brainframe | Complex Confluence formatting (macros, layouts) | Edit simplified content in Confluence, or open **View in Confluence** for full rendering. |
| Cannot save **workspace** scope | Not an administrator | Use individual scope, or ask an admin. |
| JIRA works but Confluence does not | Separate credential record required | Configure **Confluence** credentials explicitly (same token is fine). |

---

## Related integrations

| Category | Integrations | Typical entry point |
| ---- |
| **Documents** | **Confluence**, SharePoint, … | **Add from integrations** (folder NEW menu, table cloud button) |
| **Tasks** | JIRA, Asana, Monday.com, Azure DevOps, SWSD | **Task from integrations** (document bolt menu) or import/link via integrations browser |
| **Identities** | Microsoft Entra ID, … | Integrations landing page / sidebar |
| **Vulnerabilities** | Aikido, … | Integrations landing page / import browser |

For task linking from documents, see the **JIRA integration** documentation. For directory and security imports, see **Microsoft Entra ID** and **Aikido** documentation respectively.