# Confluence Documentation Updater

> Update Confluence documentation without manually finding and editing pages. Search, read, and update specific sections automatically.

Source: https://cotera.co/solutions/ops/confluence-documentation-updater

---

- **Team:** Operations
- **Tools:** Confluence
- **Difficulty:** medium
- **Setup time:** 10 min
- **Time saved:** 30 min/update

## How it works
1. **Find the Page** — Searches Confluence for documentation pages matching your topic using CQL queries
2. **Read Content** — Fetches the full page body and version info to understand the current structure
3. **Update Section** — Modifies only the target section while preserving everything else on the page
4. **Version & Verify** — Handles version control automatically and shows a before/after comparison

## Example requests
- Update the deployment process page to add a database migration step before deploying
- Find our API authentication docs and update the OAuth section with the new token format
- Update the onboarding checklist in the HR space to include the new security training requirement

## Prompt

```markdown
## Task

Use @Confluence/Search Pages to find documentation pages matching a topic, @Confluence/Get Page to read current content and version info, and @Confluence/Update Page to update specific sections while preserving the rest. Handles version control automatically to prevent conflicts.

## Input

The user provides:
1. The topic or page title to search for (e.g., "deployment process", "API authentication")
2. The specific section or content to update
3. The new information to add or replace
4. The space to search in (optional, searches all spaces if not specified)

**Example:** "Update the deployment process page in the Engineering space to add a new step for running database migrations before deploying"

## Context

### Find the Target Page

1. Use @Confluence/Search Pages with CQL to find pages matching the topic or title
2. If multiple pages match, present the options to the user for confirmation
3. Narrow results by space key if provided

### Read Current Content

1. Use @Confluence/Get Page to fetch the full page body and current version number
2. Parse the content to understand the page structure (headers, sections, lists)
3. Identify the specific section that needs updating

### Apply the Update

1. Modify the target section with the new information
2. Preserve all other sections, formatting, and content untouched
3. Maintain Confluence storage format (XHTML) compatibility
4. Use @Confluence/Update Page with the correct version number to commit the change
5. Include a meaningful version comment describing what was changed

### Verify the Update

1. Confirm the page was updated successfully
2. Show a before/after comparison of the changed section
3. Provide the page URL for review

## Output

**Documentation Updated**

**Page:** [page title]
**Space:** [space name]
**Version:** [old version] &rarr; [new version]
**Section Updated:** [section name or description]

**Change Summary:**
- [Description of what was added, removed, or modified]

**Before:**
```
[previous content of the changed section]
```

**After:**
```
[updated content of the changed section]
```

**Page URL:** [link]
**Status:** Updated successfully
```

## Related reading
- [Everyone Wants a Confluence Alternative. We Fixed Confluence Instead.](https://cotera.co/articles/confluence-vs-sharepoint-comparison.md)

