feat(tickets): source KB article on ticket creation (PMS-452 phase 1) #338

Merged
YousifShkara merged 1 commit from feat/PMS-452-kb-source-ticket into main 2026-06-23 10:33:08 +02:00
Owner

Adds tickets.source_kb_article_id (UUID NULL REFERENCES kb_articles(id) ON DELETE SET NULL) plus a partial index on (tenant_id, source_kb_article_id) WHERE source_kb_article_id IS NOT NULL. CreateTicketRequest gains an Option<Uuid> field plumbed through create_ticket's INSERT. The four existing struct-literal sites (portal, RMM ingest, demo seed, QA seed) explicitly pass None.

The point of the column is downstream reporting: with this, "which articles drive the most tickets" is one index scan over (tenant, article_id). That answers the operationally important question of where the docs are failing the user (article surfaces a flow that consistently spawns tickets => the article is the wrong shape).

ON DELETE SET NULL was chosen so retiring an article does not cascade-delete tickets that originated from it. A future "article history" follow-up could preserve the soft reference via a source_kb_article_slug snapshot; out of scope here.

Phase 2 of PMS-452 (the SPA's KB-article surface "Open ticket about this article" affordance that pre-fills the ticket form and stamps this column) is client-side and ships in a sibling PR.

#PMS-452

Adds `tickets.source_kb_article_id` (`UUID NULL REFERENCES kb_articles(id) ON DELETE SET NULL`) plus a partial index on `(tenant_id, source_kb_article_id) WHERE source_kb_article_id IS NOT NULL`. `CreateTicketRequest` gains an `Option<Uuid>` field plumbed through `create_ticket`'s INSERT. The four existing struct-literal sites (portal, RMM ingest, demo seed, QA seed) explicitly pass `None`. The point of the column is downstream reporting: with this, "which articles drive the most tickets" is one index scan over (tenant, article_id). That answers the operationally important question of where the docs are failing the user (article surfaces a flow that consistently spawns tickets => the article is the wrong shape). `ON DELETE SET NULL` was chosen so retiring an article does not cascade-delete tickets that originated from it. A future "article history" follow-up could preserve the soft reference via a `source_kb_article_slug` snapshot; out of scope here. Phase 2 of PMS-452 (the SPA's KB-article surface "Open ticket about this article" affordance that pre-fills the ticket form and stamps this column) is client-side and ships in a sibling PR. #PMS-452
feat(tickets): source KB article on ticket creation (PMS-452 phase 1)
All checks were successful
E2E / Playwright against staging (pull_request) Successful in 2m0s
Check / fmt + clippy + build + tests (pull_request) Successful in 3m52s
Integration / integration tests (pull_request) Successful in 11m18s
Create release / Create release from merged PR (pull_request) Successful in 2s
2b9f90c78e
Adds `tickets.source_kb_article_id` (`UUID NULL REFERENCES kb_articles(id) ON DELETE SET NULL`) plus a partial index on `(tenant_id, source_kb_article_id) WHERE source_kb_article_id IS NOT NULL`. `CreateTicketRequest` gains an `Option<Uuid>` field plumbed through `create_ticket`'s INSERT. The four existing struct-literal sites (portal, RMM ingest, demo seed, QA seed) explicitly pass `None`.

The point of the column is downstream reporting: with this, "which articles drive the most tickets" is one index scan over (tenant, article_id). That answers the operationally important question of where the docs are failing the user (article surfaces a flow that consistently spawns tickets => the article is the wrong shape).

`ON DELETE SET NULL` was chosen so retiring an article does not cascade-delete tickets that originated from it. A future "article history" follow-up could preserve the soft reference via a `source_kb_article_slug` snapshot; out of scope here.

Phase 2 of PMS-452 (the SPA's KB-article surface "Open ticket about this article" affordance that pre-fills the ticket form and stamps this column) is client-side and ships in a sibling PR.

#PMS-452
YousifShkara deleted branch feat/PMS-452-kb-source-ticket 2026-06-23 10:33:08 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!338
No description provided.