ITSM

Known Error Database (KEDB)

The dedicated known-error record type: full field reference, publish/expire/retire lifecycle, and the portal-facing match endpoint.

Overview

A known error is a documented root cause and workaround for a recurring problem, published so agents, the self-service portal, and the virtual agent can surface it before someone opens a duplicate ticket. FlowOS stores known errors as their own collection (separate from the Problem record's known_error status — see the note below), with a full publish/expire/retire lifecycle, view/usage counters, and links back to the problem, incidents, CIs, and knowledge article it relates to.

Known Error record vs. Problem status
FlowOS has two related but distinct things named "known error": (1) a Problem can be marked with status known_error via POST /api/itsm/problems/:id/known-error, which just flags the problem itself and stores a workaround inline on it. (2) The KnownError model documented on this page is a first-class record in its own collection (itsm_known_errors), with its own number, lifecycle, and dedicated API — this is the actual KEDB. A KnownError record can optionally reference the Problem that produced it via relatedProblemId.

Model Fields

FieldTypeRequiredDefaultDescription
numberstringrequiredauto (KE-NNNN)Human-readable identifier, generated on create.
titlestringrequiredShort summary of the known error.
descriptionstringoptional''Full description.
symptomsstringoptional''Observable symptoms used to match incidents to this entry.
rootCausestringoptional''Documented root cause.
workaroundstringoptional''Workaround text shown to agents/end users.
workaroundStepsstring[]optional[]Step-by-step workaround instructions.
affectedCiIdsObjectId[]optional[]CMDB CIs affected (ref CmdbCi).
affectedCiNamestringoptionalDenormalized CI name for display/search.
affectedServicestringoptionalAffected service name.
affectedServiceIdstringoptionalAffected service id.
ownerId / ownerNamestringoptionalOwner of the known error entry. Defaults to the creating user’s id.
relatedProblemIdObjectIdoptionalThe Problem this known error was raised from (ref Problem).
relatedProblemNumber / relatedProblemTitlestringoptionalDenormalized from the linked problem.
relatedIncidentIdsObjectId[]optional[]Incidents this known error’s workaround has been applied to (ref Incident).
relatedChangeId / relatedChangeNumberstringoptionalChange request tracking the permanent fix (plain string, not a ref).
categorystringoptional'application' (base route) / '' (dedicated route)Free-text category.
statusenumoptionaldraftdraft · published · expired · retired · closed · workaround_available
publishedAt / publishedBydate / ObjectIdoptionalSet when the record is published (ref User for publishedBy).
expiresAtdateoptionalOptional expiry date for the entry.
reviewDatedateoptionalWhen the entry is next due for review.
closedAt / closedBy / closedReasondate / string / stringoptionalSet when closed via the base route’s /close action (permanent fix applied).
articleId / articleNumberObjectId / stringoptionalLinked knowledge base article (ref KnowledgeArticle).
viewCountnumberoptional0Incremented every time the record is fetched by id.
resolvedIncidentCountnumberoptional0Incremented each time a workaround is applied to an incident.
tagsstring[]optional[]Free-form labels.
createdBystringrequiredUser id of the creator.
createdAt / updatedAttimestampoptionalautoManaged by the record.

Publish / Expire / Retire Lifecycle

  • draft — Initial status on create. Not visible to portal users.
  • published — Set via the /publish action. Sets publishedAt and publishedBy. Visible to portal/self-service consumers and returned by /match.
  • expired — Set via the /expire action, only allowed from published.
  • retired — Set via the /retire action, allowed from any status. Terminal for the dedicated (portal) route; the base route can still /publish a retired-then-reopened record only if its status is draft/expired/workaround_available.
  • closed — Base route only, via /close, requires closedReason; represents a permanent fix applied. Records closedAt, closedBy, and optionally the change that fixed it.
  • workaround_available — A valid status value accepted by PATCH on the base route, alongside the other statuses. It is treated as a publishable state for the base route’s /publish action, but is not itself set by any lifecycle action.

Numbers are generated with the KE prefix via the shared number-generator utility (e.g. KE-0001), the same mechanism used by other ITSM record types.

Two Route Files

Known errors are served by two Fastify route files mounted at different prefixes. Both operate on the same KnownError collection but serve different audiences:

Base routes — /api/itsm/known-errors

The original agent-facing CRUD surface. Creating or editing a known error requires an ITSM problem role (problem_agent, problem_manager, itil, itsm_manager, itil_admin, or an admin/owner role). It is the only surface with /close (permanent-fix closure) and /apply-to-incident (link the workaround to an incident and add an IncidentTimeline entry). PATCH here allows changing status directly.

Dedicated routes — /api/itsm/known-errors-records

A portal-friendly resource layered on top of the same collection (see the file header comment: "Batch 2A — Known Error Dedicated Routes"). List and get-by-id default to published-only results unless the caller has a privileged role (owner, admin, superadmin, itsm_manager, knowledge_manager). It adds a /match endpoint for finding published known errors that match an incident by title text, category, or CI id — useful for suggesting a workaround while an incident is being filed. Its PATCH deliberately excludes status, publishedAt, and publishedBy from the update payload; status can only move via the /publish and /retire actions, and there is no /close or /apply-to-incident here.

bash
# Create a known error (base route, agent-facing)
POST /api/itsm/known-errors
{
  "title": "Login fails after SSO token refresh",
  "symptoms": "Users see \"session expired\" immediately after SSO redirect.",
  "rootCause": "Token refresh handler drops the tenant claim.",
  "workaround": "Clear browser cookies for the app domain and log in again.",
  "workaroundSteps": ["Log out", "Clear cookies for app.example.com", "Log in again"],
  "relatedProblemId": "665f1a2b3c4d5e6f7a8b9c0d",
  "category": "authentication"
}

# Publish it
POST /api/itsm/known-errors/:id/publish

# Portal: find matches for an incoming incident
GET /api/itsm/known-errors-records/match?q=SSO&category=authentication

API Quick Reference

Base routes — /api/itsm/known-errors

GET
/api/itsm/known-errors

List known errors. Query: status, category, service, ci, problemId, q

POST
/api/itsm/known-errors

Create a known error (requires a problem/ITSM management role)

GET
/api/itsm/known-errors/:id

Get by id (increments viewCount)

PATCH
/api/itsm/known-errors/:id

Update fields, including status directly

POST
/api/itsm/known-errors/:id/publish

Publish (from draft, expired, or workaround_available)

POST
/api/itsm/known-errors/:id/close

Close with a closedReason — permanent fix applied

POST
/api/itsm/known-errors/:id/apply-to-incident

Link the workaround to an incident and log a timeline entry

POST
/api/itsm/known-errors/:id/expire

Expire (from published)

POST
/api/itsm/known-errors/:id/retire

Retire (from any status)

DELETE
/api/itsm/known-errors/:id

Delete

Dedicated (portal) routes — /api/itsm/known-errors-records

GET
/api/itsm/known-errors-records

List — published-only unless the caller has a privileged role. Query: status, category, q, limit

POST
/api/itsm/known-errors-records

Create

GET
/api/itsm/known-errors-records/match

Find published matches by q, category, or ciId (portal deflection)

GET
/api/itsm/known-errors-records/:id

Get by id (published-only unless privileged; increments viewCount)

PATCH
/api/itsm/known-errors-records/:id

Update fields (status is immutable here — use /publish or /retire)

POST
/api/itsm/known-errors-records/:id/publish

Publish (from draft or expired)

POST
/api/itsm/known-errors-records/:id/retire

Retire

DELETE
/api/itsm/known-errors-records/:id

Delete