:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(conversations): add critical ticket priority (#71550)
Abigailcfd5f4149d31
diff --git a/products/conversations/backend/api/tests/test_external.py b/products/conversations/backend/api/tests/test_external.pyindex 9ceeefca7d0a..4dc514c9cc1a 100644--- a/products/conversations/backend/api/tests/test_external.py+++ b/products/conversations/backend/api/tests/test_external.py@@ -157,7 +157,7 @@ class TestExternalTicketAPI(BaseTest):def test_patch_invalid_priority(self):response = self.client.patch(- self.url, {"priority": "critical"}, content_type="application/json", **self._auth_headers()+ self.url, {"priority": "nonexistent"}, content_type="application/json", **self._auth_headers())self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)diff --git a/products/conversations/backend/api/tickets.py b/products/conversations/backend/api/tickets.pyindex 9986e636f00c..c809aabb070e 100644--- a/products/conversations/backend/api/tickets.py+++ b/products/conversations/backend/api/tickets.py@@ -317,7 +317,7 @@ class TicketSerializer(TaggedItemSerializerMixin, serializers.ModelSerializer):)},"status": {"help_text": "Ticket status: new, open, pending, on_hold, or resolved"},- "priority": {"help_text": "Ticket priority: low, medium, or high. Null if unset."},+ "priority": {"help_text": "Ticket priority: low, medium, high, or critical. Null if unset."},"sla_due_at": {"help_text": "SLA deadline set via workflows. Null means no SLA."},"anonymous_traits": {"help_text": "Customer-provided traits such as name and email"},"organization_id": {@@ -627,7 +627,7 @@ class TicketViewSet(TaggedItemViewSetMixin, TeamAndOrgViewSetMixin, viewsets.Modlocation=OpenApiParameter.QUERY,description=("Filter by priority. Accepts a single value or a comma-separated list "- "(e.g. `medium,high`). Valid values: `low`, `medium`, `high`."+ "(e.g. `medium,high`). Valid values: `low`, `medium`, `high`, `critical`."),),OpenApiParameter(diff --git a/products/conversations/backend/migrations/0050_alter_ticket_priority.py b/products/conversations/backend/migrations/0050_alter_ticket_priority.pynew file mode 100644index 000000000000..ac49eafddc24--- /dev/null+++ b/products/conversations/backend/migrations/0050_alter_ticket_priority.py@@ -0,0 +1,27 @@+# Generated by Django 5.2.14 on 2026-07-16 13:27++from django.db import migrations, models+++class Migration(migrations.Migration):+ dependencies = [+ ("conversations", "0049_email_channel_default_constraint"),+ ]++ operations = [+ migrations.AlterField(+ model_name="ticket",+ name="priority",+ field=models.CharField(+ blank=True,+ choices=[+ ("low", "Low"),+ ("medium", "Medium"),+ ("high", "High"),+ ("critical", "Critical"),+ ],+ max_length=20,+ null=True,+ ),+ ),+ ]diff --git a/products/conversations/backend/migrations/max_migration.txt b/products/conversations/backend/migrations/max_migration.txtindex e3e222e4573a..fd5be3808f75 100644--- a/products/conversations/backend/migrations/max_migration.txt+++ b/products/conversations/backend/migrations/max_migration.txt@@ -1 +1 @@-0049_email_channel_default_constraint+0050_alter_ticket_prioritydiff --git a/products/conversations/backend/models/constants.py b/products/conversations/backend/models/constants.pyindex a2424fd3eb12..35810fe88c16 100644--- a/products/conversations/backend/models/constants.py+++ b/products/conversations/backend/models/constants.py@@ -36,6 +36,7 @@ class Priority(models.TextChoices):LOW = "low", "Low"MEDIUM = "medium", "Medium"HIGH = "high", "High"+ CRITICAL = "critical", "Critical"class RuleType(models.TextChoices):diff --git a/products/conversations/frontend/generated/api.schemas.ts b/products/conversations/frontend/generated/api.schemas.tsindex 6b9d28baa37f..70064e85e9fb 100644--- a/products/conversations/frontend/generated/api.schemas.ts+++ b/products/conversations/frontend/generated/api.schemas.ts@@ -629,6 +629,7 @@ export const TicketStatusEnumApi = {* * `low` - Low* * `medium` - Medium* * `high` - High+ * * `critical` - Critical*/export type TicketPriorityEnumApi = (typeof TicketPriorityEnumApi)[keyof typeof TicketPriorityEnumApi]@@ -636,6 +637,7 @@ export const TicketPriorityEnumApi = {Low: 'low',Medium: 'medium',High: 'high',+ Critical: 'critical',} as const/**@@ -692,11 +694,12 @@ export interface TicketApi {* * `on_hold` - On hold* * `resolved` - Resolved */status?: TicketStatusEnumApi- /** Ticket priority: low, medium, or high. Null if unset.+ /** Ticket priority: low, medium, high, or critical. Null if unset.** * `low` - Low* * `medium` - Medium- * * `high` - High */+ * * `high` - High+ * * `critical` - Critical */priority?: TicketPriorityEnumApi | BlankEnumApi | nullreadonly assignee: TicketAssignmentApi/** Customer-provided traits such as name and email */@@ -784,11 +787,12 @@ export interface PatchedTicketApi {* * `on_hold` - On hold* * `resolved` - Resolved */status?: TicketStatusEnumApi- /** Ticket priority: low, medium, or high. Null if unset.+ /** Ticket priority: low, medium, high, or critical. Null if unset.** * `low` - Low* * `medium` - Medium- * * `high` - High */+ * * `high` - High+ * * `critical` - Critical */priority?: TicketPriorityEnumApi | BlankEnumApi | nullreadonly assignee?: TicketAssignmentApi/** Customer-provided traits such as name and email */@@ -1207,7 +1211,7 @@ export type ConversationsTicketsListParams = {*/order_by?: string/**- * Filter by priority. Accepts a single value or a comma-separated list (e.g. `medium,high`). Valid values: `low`, `medium`, `high`.+ * Filter by priority. Accepts a single value or a comma-separated list (e.g. `medium,high`). Valid values: `low`, `medium`, `high`, `critical`.*/priority?: string/**diff --git a/products/conversations/frontend/generated/api.zod.ts b/products/conversations/frontend/generated/api.zod.tsindex 3854e16d0d68..ca77028e6e20 100644--- a/products/conversations/frontend/generated/api.zod.ts+++ b/products/conversations/frontend/generated/api.zod.ts@@ -165,13 +165,15 @@ export const ConversationsTicketsCreateBody = /* @__PURE__ */ zod),priority: zod.union([- zod.enum(['low', 'medium', 'high']).describe('\* `low` - Low\n\* `medium` - Medium\n\* `high` - High'),+ zod+ .enum(['low', 'medium', 'high', 'critical'])+ .describe('\* `low` - Low\n\* `medium` - Medium\n\* `high` - High\n\* `critical` - Critical'),zod.enum(['']),zod.null(),]).optional().describe(- 'Ticket priority: low, medium, or high. Null if unset.\n\n\* `low` - Low\n\* `medium` - Medium\n\* `high` - High'+ 'Ticket priority: low, medium, high, or critical. Null if unset.\n\n\* `low` - Low\n\* `medium` - Medium\n\* `high` - High\n\* `critical` - Critical'),anonymous_traits: zod.unknown().optional().describe('Customer-provided traits such as name and email'),ai_resolved: zod.boolean().optional(),@@ -201,13 +203,15 @@ export const ConversationsTicketsUpdateBody = /* @__PURE__ */ zod),priority: zod.union([- zod.enum(['low', 'medium', 'high']).describe('\* `low` - Low\n\* `medium` - Medium\n\* `high` - High'),+ zod+ .enum(['low', 'medium', 'high', 'critical'])+ .describe('\* `low` - Low\n\* `medium` - Medium\n\* `high` - High\n\* `critical` - Critical'),zod.enum(['']),zod.null(),]).optional().describe(- 'Ticket priority: low, medium, or high. Null if unset.\n\n\* `low` - Low\n\* `medium` - Medium\n\* `high` - High'+ 'Ticket priority: low, medium, high, or critical. Null if unset.\n\n\* `low` - Low\n\* `medium` - Medium\n\* `high` - High\n\* `critical` - Critical'),anonymous_traits: zod.unknown().optional().describe('Customer-provided traits such as name and email'),ai_resolved: zod.boolean().optional(),@@ -234,13 +238,15 @@ export const ConversationsTicketsPartialUpdateBody = /* @__PURE__ */ zod),priority: zod.union([- zod.enum(['low', 'medium', 'high']).describe('\* `low` - Low\n\* `medium` - Medium\n\* `high` - High'),+ zod+ .enum(['low', 'medium', 'high', 'critical'])+ .describe('\* `low` - Low\n\* `medium` - Medium\n\* `high` - High\n\* `critical` - Critical'),zod.enum(['']),zod.null(),]).optional().describe(- 'Ticket priority: low, medium, or high. Null if unset.\n\n\* `low` - Low\n\* `medium` - Medium\n\* `high` - High'+ 'Ticket priority: low, medium, high, or critical. Null if unset.\n\n\* `low` - Low\n\* `medium` - Medium\n\* `high` - High\n\* `critical` - Critical'),anonymous_traits: zod.unknown().optional().describe('Customer-provided traits such as name and email'),ai_resolved: zod.boolean().optional(),diff --git a/products/conversations/frontend/scenes/tickets/SupportTicketsScene.tsx b/products/conversations/frontend/scenes/tickets/SupportTicketsScene.tsxindex a237b44e0d06..b5e6e1cba74b 100644--- a/products/conversations/frontend/scenes/tickets/SupportTicketsScene.tsx+++ b/products/conversations/frontend/scenes/tickets/SupportTicketsScene.tsx@@ -159,7 +159,15 @@ export const SUPPORT_TICKETS_TABLE_COLUMNS: LemonTableColumns<Ticket> = [render: (_, ticket) =>ticket.priority ? (<LemonTag- type={ticket.priority === 'high' ? 'danger' : ticket.priority === 'medium' ? 'warning' : 'default'}+ type={+ ticket.priority === 'critical'+ ? 'danger'+ : ticket.priority === 'high'+ ? 'caution'+ : ticket.priority === 'medium'+ ? 'warning'+ : 'default'+ }>{ticket.priority}</LemonTag>diff --git a/products/conversations/frontend/types.ts b/products/conversations/frontend/types.tsindex 65d002b0fe1f..e2e252f42275 100644--- a/products/conversations/frontend/types.ts+++ b/products/conversations/frontend/types.ts@@ -15,7 +15,7 @@ export type TicketChannelDetail =| 'widget_api'| 'github_issue'export type TicketSlaState = 'on-track' | 'at-risk' | 'breached'-export type TicketPriority = 'low' | 'medium' | 'high'+export type TicketPriority = 'low' | 'medium' | 'high' | 'critical'export type SceneTabKey = 'tickets' | 'settings'export type MessageAuthorType = 'customer' | 'AI' | 'human'export type MessageDeliveryStatus = 'sent' | 'read'@@ -236,6 +236,7 @@ export const priorityOptions: { value: TicketPriority; label: string }[] = [{ value: 'low', label: 'Low' },{ value: 'medium', label: 'Medium' },{ value: 'high', label: 'High' },+ { value: 'critical', label: 'Critical' },]// Multiselect-compatible options for LemonInputSelect@@ -243,6 +244,7 @@ export const priorityMultiselectOptions: { key: TicketPriority; label: string }[{ key: 'low', label: 'Low' },{ key: 'medium', label: 'Medium' },{ key: 'high', label: 'High' },+ { key: 'critical', label: 'Critical' },]export const channelOptions: { value: TicketChannel | 'all'; label: string }[] = [diff --git a/products/conversations/mcp/tools.yaml b/products/conversations/mcp/tools.yamlindex 63c36a9b5ef7..e28c56dff755 100644--- a/products/conversations/mcp/tools.yaml+++ b/products/conversations/mcp/tools.yaml@@ -43,9 +43,9 @@ tools:title: List support ticketsdescription: >List support tickets in the project. Supports filtering by status (new, open, pending, on_hold, resolved),- priority (low, medium, high), channel_source (widget, email, slack), assignee, date range, and search.- Results are paginated and ordered by updated_at descending by default. Returns ticket metadata including- status, priority, message counts, and timestamps.+ priority (low, medium, high, critical), channel_source (widget, email, slack), assignee, date range, and+ search. Results are paginated and ordered by updated_at descending by default. Returns ticket metadata+ including status, priority, message counts, and timestamps.response:include:- id@@ -143,8 +143,8 @@ tools:title: Update support ticketdescription: >Update a support ticket. Can change status (new, open, pending, on_hold, resolved), priority (low, medium,- high), assignee, SLA deadline, escalation reason, and tags. Assignee should be an object with type ('user'- or 'role') and id, or null to unassign.+ high, critical), assignee, SLA deadline, escalation reason, and tags. Assignee should be an object with type+ ('user' or 'role') and id, or null to unassign.exclude_params:- anonymous_traits- ai_resolveddiff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 03c26878c219..e11329388e60 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -1830,7 +1830,7 @@}},"conversations-tickets-list": {- "description": "List support tickets in the project. Supports filtering by status (new, open, pending, on_hold, resolved), priority (low, medium, high), channel_source (widget, email, slack), assignee, date range, and search. Results are paginated and ordered by updated_at descending by default. Returns ticket metadata including status, priority, message counts, and timestamps.",+ "description": "List support tickets in the project. Supports filtering by status (new, open, pending, on_hold, resolved), priority (low, medium, high, critical), channel_source (widget, email, slack), assignee, date range, and search. Results are paginated and ordered by updated_at descending by default. Returns ticket metadata including status, priority, message counts, and timestamps.","category": "Conversations","feature": "conversations","summary": "List support tickets",@@ -1886,7 +1886,7 @@}},"conversations-tickets-update": {- "description": "Update a support ticket. Can change status (new, open, pending, on_hold, resolved), priority (low, medium, high), assignee, SLA deadline, escalation reason, and tags. Assignee should be an object with type ('user' or 'role') and id, or null to unassign.",+ "description": "Update a support ticket. Can change status (new, open, pending, on_hold, resolved), priority (low, medium, high, critical), assignee, SLA deadline, escalation reason, and tags. Assignee should be an object with type ('user' or 'role') and id, or null to unassign.","category": "Conversations","feature": "conversations","summary": "Update support ticket",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex 0de391cb3d48..c77cc4c1e878 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -1859,7 +1859,7 @@}},"conversations-tickets-list": {- "description": "List support tickets in the project. Supports filtering by status (new, open, pending, on_hold, resolved), priority (low, medium, high), channel_source (widget, email, slack), assignee, date range, and search. Results are paginated and ordered by updated_at descending by default. Returns ticket metadata including status, priority, message counts, and timestamps.",+ "description": "List support tickets in the project. Supports filtering by status (new, open, pending, on_hold, resolved), priority (low, medium, high, critical), channel_source (widget, email, slack), assignee, date range, and search. Results are paginated and ordered by updated_at descending by default. Returns ticket metadata including status, priority, message counts, and timestamps.","category": "Conversations","feature": "conversations","summary": "List support tickets",@@ -1915,7 +1915,7 @@}},"conversations-tickets-update": {- "description": "Update a support ticket. Can change status (new, open, pending, on_hold, resolved), priority (low, medium, high), assignee, SLA deadline, escalation reason, and tags. Assignee should be an object with type ('user' or 'role') and id, or null to unassign.",+ "description": "Update a support ticket. Can change status (new, open, pending, on_hold, resolved), priority (low, medium, high, critical), assignee, SLA deadline, escalation reason, and tags. Assignee should be an object with type ('user' or 'role') and id, or null to unassign.","category": "Conversations","feature": "conversations","summary": "Update support ticket",diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex ac7e99cb1f30..c277bffe2193 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -40898,6 +40898,7 @@ export namespace Schemas {* * `low` - Low* * `medium` - Medium* * `high` - High+ * * `critical` - Critical*/export type TicketPriorityEnum = typeof TicketPriorityEnum[keyof typeof TicketPriorityEnum];@@ -40906,6 +40907,7 @@ export namespace Schemas {Low: 'low',Medium: 'medium',High: 'high',+ Critical: 'critical',} as const;/**@@ -40962,11 +40964,12 @@ export namespace Schemas {* * `on_hold` - On hold* * `resolved` - Resolved */status?: TicketStatusEnum;- /** Ticket priority: low, medium, or high. Null if unset.+ /** Ticket priority: low, medium, high, or critical. Null if unset.** * `low` - Low* * `medium` - Medium- * * `high` - High */+ * * `high` - High+ * * `critical` - Critical */priority?: TicketPriorityEnum | BlankEnum | null;readonly assignee: TicketAssignment;/** Customer-provided traits such as name and email */@@ -48686,11 +48689,12 @@ export namespace Schemas {* * `on_hold` - On hold* * `resolved` - Resolved */status?: TicketStatusEnum;- /** Ticket priority: low, medium, or high. Null if unset.+ /** Ticket priority: low, medium, high, or critical. Null if unset.** * `low` - Low* * `medium` - Medium- * * `high` - High */+ * * `high` - High+ * * `critical` - Critical */priority?: TicketPriorityEnum | BlankEnum | null;readonly assignee?: TicketAssignment;/** Customer-provided traits such as name and email */@@ -71503,7 +71507,7 @@ export namespace Schemas {*/order_by?: string;/**- * Filter by priority. Accepts a single value or a comma-separated list (e.g. `medium,high`). Valid values: `low`, `medium`, `high`.+ * Filter by priority. Accepts a single value or a comma-separated list (e.g. `medium,high`). Valid values: `low`, `medium`, `high`, `critical`.*/priority?: string;/**diff --git a/services/mcp/src/generated/conversations/api.ts b/services/mcp/src/generated/conversations/api.tsindex da714456407e..acab95f27ebb 100644--- a/services/mcp/src/generated/conversations/api.ts+++ b/services/mcp/src/generated/conversations/api.ts@@ -67,7 +67,7 @@ export const ConversationsTicketsListQueryParams = /* @__PURE__ */ zod.object({.string().optional().describe(- 'Filter by priority. Accepts a single value or a comma-separated list (e.g. `medium,high`). Valid values: `low`, `medium`, `high`.'+ 'Filter by priority. Accepts a single value or a comma-separated list (e.g. `medium,high`). Valid values: `low`, `medium`, `high`, `critical`.'),search: zod.string()@@ -141,13 +141,15 @@ export const ConversationsTicketsPartialUpdateBody = /* @__PURE__ */ zod),priority: zod.union([- zod.enum(['low', 'medium', 'high']).describe('* `low` - Low\n* `medium` - Medium\n* `high` - High'),+ zod+ .enum(['low', 'medium', 'high', 'critical'])+ .describe('* `low` - Low\n* `medium` - Medium\n* `high` - High\n* `critical` - Critical'),zod.enum(['']),zod.null(),]).optional().describe(- 'Ticket priority: low, medium, or high. Null if unset.\n\n* `low` - Low\n* `medium` - Medium\n* `high` - High'+ 'Ticket priority: low, medium, high, or critical. Null if unset.\n\n* `low` - Low\n* `medium` - Medium\n* `high` - High\n* `critical` - Critical'),sla_due_at: zod.iso.datetime({ offset: true })diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-tickets-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-tickets-list.jsonindex e8b9cb1d1016..3a2c9636033a 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-tickets-list.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-tickets-list.json@@ -49,7 +49,7 @@"type": "string"},"priority": {- "description": "Filter by priority. Accepts a single value or a comma-separated list (e.g. `medium,high`). Valid values: `low`, `medium`, `high`.",+ "description": "Filter by priority. Accepts a single value or a comma-separated list (e.g. `medium,high`). Valid values: `low`, `medium`, `high`, `critical`.","type": "string"},"search": {diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-tickets-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-tickets-update.jsonindex 8c04c1e6f155..718d529e2e0c 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-tickets-update.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-tickets-update.json@@ -8,8 +8,8 @@"priority": {"anyOf": [{- "description": "* `low` - Low\n* `medium` - Medium\n* `high` - High",- "enum": ["low", "medium", "high"],+ "description": "* `low` - Low\n* `medium` - Medium\n* `high` - High\n* `critical` - Critical",+ "enum": ["low", "medium", "high", "critical"],"type": "string"},{@@ -20,7 +20,7 @@"type": "null"}],- "description": "Ticket priority: low, medium, or high. Null if unset.\n\n* `low` - Low\n* `medium` - Medium\n* `high` - High"+ "description": "Ticket priority: low, medium, high, or critical. Null if unset.\n\n* `low` - Low\n* `medium` - Medium\n* `high` - High\n* `critical` - Critical"},"sla_due_at": {"anyOf": [