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

# ITSM Article

> View, create, and edit IT knowledge base articles with tags, version history, helpful voting, and publication status management.

The Article screen displays a single knowledge-base article identified by its `id` parameter and is accessible at `/it/knowledge-base/:id`.

## Overview

The Article screen loads an article by its URL `id` parameter and increments its `view_count` on mount via the `useKnowledgeBaseMutations` hook. The page header displays the article title, a `KBCategoryBadge`, a `KBStatusBadge`, the total view count, and the published date. Article body HTML is rendered using `sanitizeHtml` to prevent XSS. Tags are displayed as secondary badges. When the article `status` is `published`, helpful/not-helpful voting buttons (`KBHelpfulButtons`) appear below the content. Users with the `it.knowledge_base.manage` permission also see a version-history panel (`ArticleVersionHistory`); users with `it.knowledge_base.edit` see an Edit button linking to `/it/knowledge-base/:id/edit`.

## Who it's for

Requires `IT_PERMISSIONS.VIEW` (outer `ITViewGuard`). No additional per-route permission gate on this route.

## Before you start

* You must hold `IT_PERMISSIONS.VIEW` to navigate to this screen.
* The article must exist and be reachable via its `id`.

## Steps

<Steps>
  <Step title="Navigate to an article">
    Click an article link in the Knowledge Base portal or enter `/it/knowledge-base/<id>` directly.
  </Step>

  <Step title="Read the article">
    Scroll through the sanitized HTML content rendered in the article card.
  </Step>

  <Step title="Vote on helpfulness">
    If the article is published, click the **Helpful** or **Not Helpful** button to submit your vote.
  </Step>

  <Step title="Edit the article (editors only)">
    Users with the `it.knowledge_base.edit` permission see an **Edit** button in the top-right. Click it to navigate to the edit screen.
  </Step>
</Steps>

## Key concepts

* **view\_count** — Automatically incremented each time the article page loads.
* **helpful\_count / not\_helpful\_count** — Aggregate vote tallies shown in the helpful-voting component.
* **KBStatusBadge** — Reflects the article `status` field (e.g., `published`, `archived`).
* **ArticleVersionHistory** — Visible only to users with `it.knowledge_base.manage` permission.

## Creating an article

The New Article page (`/it/knowledge-base/new`) provides a form for creating a new IT knowledge base article. On successful creation the user is redirected to the article management list.

The page renders `KBArticleForm` which collects: `title`, `category`, `summary` (optional), `content`, `tags` (string array), and `status`. On submit it calls `createArticle.mutateAsync` with `custom_fields: {}` appended, then navigates to `/it/knowledge-base/manage`.

No explicit secondary permission gate at the route level beyond the outer `ITViewGuard` (`it.view`). Creating articles requires `it.knowledge_base.create` at the API layer.

Before you start: hold the `it.knowledge_base.create` permission and prepare the article content and select an appropriate category before starting.

1. From the Manage Articles page, click **New Article**, or navigate directly to `/it/knowledge-base/new`.
2. Fill in the title, select a category, add an optional summary, and write the article content.
3. Add relevant tags to improve searchability.
4. Choose whether to publish the article immediately or save it as a draft.
5. Click the submit button. On success you are redirected to the article management list.

## Editing an article

The Edit Article screen allows updating an existing knowledge base article and is accessible at `/it/knowledge-base/:id/edit`.

The Edit Article page loads the existing article via `useKnowledgeBaseArticle`. If the article is not found, a fallback message is shown with a back button. The form is rendered via the `KBArticleForm` component pre-populated with the existing article data. Two additional action buttons appear in the page header: **Archive** (visible unless the article is already archived, calls `archiveArticle` and redirects to `/it/knowledge-base/manage`) and **Delete** (opens a confirmation alert dialog, calls `deleteArticle` and redirects to `/it/knowledge-base/manage`). On save, `updateArticle` is called and the user is redirected to the article read view.

Requires `IT_PERMISSIONS.VIEW` (outer `ITViewGuard`). The article read view gatekeeps the edit button behind `it.knowledge_base.edit` permission; the route itself has no separate permission wrapper.

Before you start: hold the `it.knowledge_base.edit` permission to reach this screen from the article read view. The article must exist.

1. From the article read view (accessible to users with `it.knowledge_base.edit`), click the **Edit** button.
2. Modify fields in the `KBArticleForm` and click the save/submit action.
3. To archive: click **Archive** in the top action area. This redirects to the article management list.
4. To delete: click **Delete** and confirm in the alert dialog to permanently delete the article.

**KBArticleForm** — Shared form component used for both creating and editing articles.\
**archiveArticle** — Sets the article status to archived; the button is hidden if the article is already archived.\
**deleteArticle** — Permanently removes the article; action is irreversible.

## Related

<Columns cols={2}>
  <Card title="IT Service Management" icon="headset" href="/it/overview">
    IT Service Management overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/it.tsx
  * src/cores/it/pages/knowledge-base/KnowledgeBaseArticlePage.tsx
  * src/cores/it/pages/knowledge-base/NewKnowledgeBaseArticlePage.tsx
  * src/cores/it/pages/knowledge-base/EditKnowledgeBaseArticlePage.tsx
  * src/cores/it/hooks/useKnowledgeBaseMutations.ts
</Accordion>
