feat(tickets): source KB article on ticket creation (PMS-452 phase 1) #338
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-server!338
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-452-kb-source-ticket"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.CreateTicketRequestgains anOption<Uuid>field plumbed throughcreate_ticket's INSERT. The four existing struct-literal sites (portal, RMM ingest, demo seed, QA seed) explicitly passNone.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 NULLwas 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 asource_kb_article_slugsnapshot; 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