Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

webhooks/intercom: Add webhook fixtures for ticket events.

sathwikshetty3332a1488f6f87
diff --git a/zerver/webhooks/intercom/fixtures/ticket_admin_assigned.json b/zerver/webhooks/intercom/fixtures/ticket_admin_assigned.json
new file mode 100644
index 00000000000..2ac8801638a
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/ticket_admin_assigned.json
@@ -0,0 +1,270 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "ticket_ticket_part",
+ "ticket": {
+ "type": "ticket",
+ "id": "215472629311235",
+ "ticket_id": "66040342",
+ "ticket_attributes": {
+ "_default_title_": "Unclear user message 'erf' with pending email response",
+ "_default_description_": "User sent an unclear message 'erf' and was informed that replies will be sent here and to [email protected]; awaiting further clarification or response.",
+ "Platforms": null,
+ "Root cause": null
+ },
+ "ticket_state": {
+ "type": "ticket_state",
+ "id": "4517893",
+ "category": "submitted",
+ "internal_label": "Submitted",
+ "external_label": "Submitted"
+ },
+ "ticket_type": {
+ "type": "ticket_type",
+ "id": "2979330",
+ "name": "Tickets",
+ "description": "When a customer query can’t be instantly resolved, convert to support request ticket to ensure the right details are captured and allow customers to keep track of progress.",
+ "icon": "🎟",
+ "workspace_id": "abc123def",
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651,
+ "is_internal": false,
+ "ticket_type_attributes": {
+ "type": "list",
+ "data": [
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514183",
+ "workspace_id": "abc123def",
+ "name": "_default_title_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 0,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514184",
+ "workspace_id": "abc123def",
+ "name": "_default_description_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": true
+ },
+ "order": 1,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514185",
+ "workspace_id": "abc123def",
+ "name": "Platforms",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 2,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514186",
+ "workspace_id": "abc123def",
+ "name": "Root cause",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 3,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ }
+ ]
+ },
+ "category": "Customer"
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696346bbaebb5a479d3851a3",
+ "external_id": "f7c0bc1e-5ee2-46a0-b11a-ea473d1101a5"
+ }
+ ]
+ },
+ "admin_assignee_id": "9608799",
+ "team_assignee_id": "0",
+ "created_at": 1768113868,
+ "updated_at": 1768114389,
+ "ticket_parts": {
+ "type": "ticket_part.list",
+ "ticket_parts": [
+ {
+ "type": "ticket_part",
+ "id": "37403241257",
+ "part_type": "attribute_collected",
+ "created_at": 1768113868,
+ "updated_at": 1768113868,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403241627",
+ "part_type": "language_detection_details",
+ "created_at": 1768113869,
+ "updated_at": 1768113869,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403242516",
+ "part_type": "channel_and_reply_time_expectation",
+ "body": "<p>You’ll get replies here and in your email:<br>✉️ <b>[email protected]</b></p>\n<p>The team will reply as soon as they can.</p>",
+ "created_at": 1768113872,
+ "updated_at": 1768113872,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403374462",
+ "part_type": "ticket_state_updated_by_admin",
+ "ticket_state": "submitted",
+ "previous_ticket_state": "submitted",
+ "created_at": 1768114250,
+ "updated_at": 1768114250,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403424009",
+ "part_type": "assignment",
+ "created_at": 1768114389,
+ "updated_at": 1768114389,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ }
+ ],
+ "total_count": 5
+ },
+ "open": true,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "category": "Customer",
+ "is_shared": true,
+ "channel": "messenger"
+ },
+ "ticket_part": {
+ "type": "ticket_part",
+ "id": "37403424009",
+ "part_type": "assignment",
+ "created_at": 1768114389,
+ "updated_at": 1768114389,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_96c4d0fa-4084-46b0-9a52-bb5565c98060",
+ "topic": "ticket.admin.assigned",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768114390,
+ "created_at": 1768114390,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/ticket_admin_replied.json b/zerver/webhooks/intercom/fixtures/ticket_admin_replied.json
new file mode 100644
index 00000000000..945ace5addd
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/ticket_admin_replied.json
@@ -0,0 +1,349 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "ticket_ticket_part",
+ "ticket": {
+ "type": "ticket",
+ "id": "215472629311235",
+ "ticket_id": "66040342",
+ "ticket_attributes": {
+ "_default_title_": "Unclear user message 'erf' with pending email response",
+ "_default_description_": "User sent an unclear message 'erf' and was informed that replies will be sent here and to [email protected]; awaiting further clarification or response.",
+ "Platforms": null,
+ "Root cause": null
+ },
+ "ticket_state": {
+ "type": "ticket_state",
+ "id": "4517893",
+ "category": "submitted",
+ "internal_label": "Submitted",
+ "external_label": "Submitted"
+ },
+ "ticket_type": {
+ "type": "ticket_type",
+ "id": "2979330",
+ "name": "Tickets",
+ "description": "When a customer query can’t be instantly resolved, convert to support request ticket to ensure the right details are captured and allow customers to keep track of progress.",
+ "icon": "🎟",
+ "workspace_id": "abc123def",
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651,
+ "is_internal": false,
+ "ticket_type_attributes": {
+ "type": "list",
+ "data": [
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514183",
+ "workspace_id": "abc123def",
+ "name": "_default_title_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 0,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514184",
+ "workspace_id": "abc123def",
+ "name": "_default_description_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": true
+ },
+ "order": 1,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514185",
+ "workspace_id": "abc123def",
+ "name": "Platforms",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 2,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514186",
+ "workspace_id": "abc123def",
+ "name": "Root cause",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 3,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ }
+ ]
+ },
+ "category": "Customer"
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696346bbaebb5a479d3851a3",
+ "external_id": "f7c0bc1e-5ee2-46a0-b11a-ea473d1101a5"
+ }
+ ]
+ },
+ "admin_assignee_id": "9608799",
+ "team_assignee_id": "0",
+ "created_at": 1768113868,
+ "updated_at": 1768114530,
+ "ticket_parts": {
+ "type": "ticket_part.list",
+ "ticket_parts": [
+ {
+ "type": "ticket_part",
+ "id": "37403241257",
+ "part_type": "attribute_collected",
+ "created_at": 1768113868,
+ "updated_at": 1768113868,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403241627",
+ "part_type": "language_detection_details",
+ "created_at": 1768113869,
+ "updated_at": 1768113869,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403242516",
+ "part_type": "channel_and_reply_time_expectation",
+ "body": "<p>You’ll get replies here and in your email:<br>✉️ <b>[email protected]</b></p>\n<p>The team will reply as soon as they can.</p>",
+ "created_at": 1768113872,
+ "updated_at": 1768113872,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403374462",
+ "part_type": "ticket_state_updated_by_admin",
+ "ticket_state": "submitted",
+ "previous_ticket_state": "submitted",
+ "created_at": 1768114250,
+ "updated_at": 1768114250,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403424009",
+ "part_type": "assignment",
+ "created_at": 1768114389,
+ "updated_at": 1768114389,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403439476",
+ "part_type": "assignment",
+ "created_at": 1768114432,
+ "updated_at": 1768114432,
+ "assigned_to": {
+ "type": "team",
+ "id": "9680998"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403461654",
+ "part_type": "assignment",
+ "body": "<p class=\"no-margin\">AD</p>",
+ "created_at": 1768114494,
+ "updated_at": 1768114494,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403467236",
+ "part_type": "assignment",
+ "created_at": 1768114511,
+ "updated_at": 1768114511,
+ "assigned_to": {
+ "type": "nobody_admin",
+ "id": null
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403474386",
+ "part_type": "assignment",
+ "body": "<p class=\"no-margin\">mathew</p>",
+ "created_at": 1768114530,
+ "updated_at": 1768114530,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ }
+ ],
+ "total_count": 9
+ },
+ "open": true,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "category": "Customer",
+ "is_shared": true,
+ "channel": "messenger"
+ },
+ "ticket_part": {
+ "type": "ticket_part",
+ "id": "37403474386",
+ "part_type": "assignment",
+ "body": "<p class=\"no-margin\">mathew</p>",
+ "created_at": 1768114530,
+ "updated_at": 1768114530,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_4a953277-d6d9-45e7-ac5c-47bf8e8fe24b",
+ "topic": "ticket.admin.replied",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768114531,
+ "created_at": 1768114531,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/ticket_attribute_updated.json b/zerver/webhooks/intercom/fixtures/ticket_attribute_updated.json
new file mode 100644
index 00000000000..3cdd0ab5de2
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/ticket_attribute_updated.json
@@ -0,0 +1,400 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "ticket_ticket_part",
+ "ticket": {
+ "type": "ticket",
+ "id": "215472629311235",
+ "ticket_id": "66040342",
+ "ticket_attributes": {
+ "_default_title_": "Unclear user message 'erf' with pending email response",
+ "_default_description_": "User sent an unclear message 'erf' and was informed that replies will be sent here and to [email protected]; awaiting further clarification or response.",
+ "Platforms": "rewg",
+ "Root cause": null
+ },
+ "ticket_state": {
+ "type": "ticket_state",
+ "id": "4517893",
+ "category": "submitted",
+ "internal_label": "Submitted",
+ "external_label": "Submitted"
+ },
+ "ticket_type": {
+ "type": "ticket_type",
+ "id": "2979330",
+ "name": "Tickets",
+ "description": "When a customer query can’t be instantly resolved, convert to support request ticket to ensure the right details are captured and allow customers to keep track of progress.",
+ "icon": "🎟",
+ "workspace_id": "abc123def",
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651,
+ "is_internal": false,
+ "ticket_type_attributes": {
+ "type": "list",
+ "data": [
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514183",
+ "workspace_id": "abc123def",
+ "name": "_default_title_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 0,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514184",
+ "workspace_id": "abc123def",
+ "name": "_default_description_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": true
+ },
+ "order": 1,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514185",
+ "workspace_id": "abc123def",
+ "name": "Platforms",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 2,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514186",
+ "workspace_id": "abc123def",
+ "name": "Root cause",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 3,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ }
+ ]
+ },
+ "category": "Customer"
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696346bbaebb5a479d3851a3",
+ "external_id": "f7c0bc1e-5ee2-46a0-b11a-ea473d1101a5"
+ }
+ ]
+ },
+ "admin_assignee_id": "9608799",
+ "team_assignee_id": "0",
+ "created_at": 1768113868,
+ "updated_at": 1768114679,
+ "ticket_parts": {
+ "type": "ticket_part.list",
+ "ticket_parts": [
+ {
+ "type": "ticket_part",
+ "id": "37403241257",
+ "part_type": "attribute_collected",
+ "created_at": 1768113868,
+ "updated_at": 1768113868,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403241627",
+ "part_type": "language_detection_details",
+ "created_at": 1768113869,
+ "updated_at": 1768113869,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403242516",
+ "part_type": "channel_and_reply_time_expectation",
+ "body": "<p>You’ll get replies here and in your email:<br>✉️ <b>[email protected]</b></p>\n<p>The team will reply as soon as they can.</p>",
+ "created_at": 1768113872,
+ "updated_at": 1768113872,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403374462",
+ "part_type": "ticket_state_updated_by_admin",
+ "ticket_state": "submitted",
+ "previous_ticket_state": "submitted",
+ "created_at": 1768114250,
+ "updated_at": 1768114250,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403424009",
+ "part_type": "assignment",
+ "created_at": 1768114389,
+ "updated_at": 1768114389,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403439476",
+ "part_type": "assignment",
+ "created_at": 1768114432,
+ "updated_at": 1768114432,
+ "assigned_to": {
+ "type": "team",
+ "id": "9680998"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403461654",
+ "part_type": "assignment",
+ "body": "<p class=\"no-margin\">AD</p>",
+ "created_at": 1768114494,
+ "updated_at": 1768114494,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403467236",
+ "part_type": "assignment",
+ "created_at": 1768114511,
+ "updated_at": 1768114511,
+ "assigned_to": {
+ "type": "nobody_admin",
+ "id": null
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403474386",
+ "part_type": "assignment",
+ "body": "<p class=\"no-margin\">mathew</p>",
+ "created_at": 1768114530,
+ "updated_at": 1768114530,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403497489",
+ "part_type": "title_changed",
+ "created_at": 1768114596,
+ "updated_at": 1768114596,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403526220",
+ "part_type": "ticket_attribute_updated_by_admin",
+ "created_at": 1768114679,
+ "updated_at": 1768114679,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false,
+ "updated_attribute_data": {
+ "attribute": {
+ "type": "attribute",
+ "id": "8514185",
+ "label": "Platforms"
+ },
+ "value": {
+ "type": "value",
+ "id": "rewg",
+ "label": "rewg",
+ "previous": ""
+ }
+ }
+ }
+ ],
+ "total_count": 11
+ },
+ "open": true,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "category": "Customer",
+ "is_shared": true,
+ "channel": "messenger"
+ },
+ "ticket_part": {
+ "type": "ticket_part",
+ "id": "37403526220",
+ "part_type": "ticket_attribute_updated_by_admin",
+ "created_at": 1768114679,
+ "updated_at": 1768114679,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false,
+ "updated_attribute_data": {
+ "attribute": {
+ "type": "attribute",
+ "id": "8514185",
+ "label": "Platforms"
+ },
+ "value": {
+ "type": "value",
+ "id": "rewg",
+ "label": "rewg",
+ "previous": ""
+ }
+ }
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_6be9baac-fd68-49c2-8f41-28d7f7deb994",
+ "topic": "ticket.attribute.updated",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768114680,
+ "created_at": 1768114679,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/ticket_closed.json b/zerver/webhooks/intercom/fixtures/ticket_closed.json
new file mode 100644
index 00000000000..ed280b0d3db
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/ticket_closed.json
@@ -0,0 +1,402 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "ticket",
+ "id": "215472629311235",
+ "ticket_id": "66040342",
+ "ticket_attributes": {
+ "_default_title_": "Unclear user message 'erf' with pending email response",
+ "_default_description_": "User sent an unclear message 'erf' and was informed that replies will be sent here and to [email protected]; awaiting further clarification or response.",
+ "Platforms": "rewg",
+ "Root cause": null
+ },
+ "ticket_state": {
+ "type": "ticket_state",
+ "id": "4517896",
+ "category": "resolved",
+ "internal_label": "Resolved",
+ "external_label": "Resolved"
+ },
+ "ticket_type": {
+ "type": "ticket_type",
+ "id": "2979330",
+ "name": "Tickets",
+ "description": "When a customer query can’t be instantly resolved, convert to support request ticket to ensure the right details are captured and allow customers to keep track of progress.",
+ "icon": "🎟",
+ "workspace_id": "abc123def",
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651,
+ "is_internal": false,
+ "ticket_type_attributes": {
+ "type": "list",
+ "data": [
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514183",
+ "workspace_id": "abc123def",
+ "name": "_default_title_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 0,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514184",
+ "workspace_id": "abc123def",
+ "name": "_default_description_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": true
+ },
+ "order": 1,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514185",
+ "workspace_id": "abc123def",
+ "name": "Platforms",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 2,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514186",
+ "workspace_id": "abc123def",
+ "name": "Root cause",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 3,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ }
+ ]
+ },
+ "category": "Customer"
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "id": "696346bbaebb5a479d3851a3",
+ "role": "lead"
+ }
+ ]
+ },
+ "admin_assignee_id": "9608799",
+ "team_assignee_id": "0",
+ "created_at": 1768113868,
+ "updated_at": 1768117266,
+ "ticket_parts": {
+ "type": "ticket_part.list",
+ "ticket_parts": [
+ {
+ "type": "ticket_part",
+ "id": "37403241257",
+ "part_type": "attribute_collected",
+ "created_at": 1768113868,
+ "updated_at": 1768113868,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403241627",
+ "part_type": "language_detection_details",
+ "created_at": 1768113869,
+ "updated_at": 1768113869,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403242516",
+ "part_type": "channel_and_reply_time_expectation",
+ "body": "<p>You’ll get replies here and in your email:<br>✉️ <b>[email protected]</b></p>\n<p>The team will reply as soon as they can.</p>",
+ "created_at": 1768113872,
+ "updated_at": 1768113872,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403374462",
+ "part_type": "ticket_state_updated_by_admin",
+ "ticket_state": "submitted",
+ "previous_ticket_state": "submitted",
+ "created_at": 1768114250,
+ "updated_at": 1768114250,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403424009",
+ "part_type": "assignment",
+ "created_at": 1768114389,
+ "updated_at": 1768114389,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403439476",
+ "part_type": "assignment",
+ "created_at": 1768114432,
+ "updated_at": 1768114432,
+ "assigned_to": {
+ "type": "team",
+ "id": "9680998"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403461654",
+ "part_type": "assignment",
+ "body": "<p class=\"no-margin\">AD</p>",
+ "created_at": 1768114494,
+ "updated_at": 1768114494,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403467236",
+ "part_type": "assignment",
+ "created_at": 1768114511,
+ "updated_at": 1768114511,
+ "assigned_to": {
+ "type": "nobody_admin",
+ "id": null
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403474386",
+ "part_type": "assignment",
+ "body": "<p class=\"no-margin\">mathew</p>",
+ "created_at": 1768114530,
+ "updated_at": 1768114530,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403497489",
+ "part_type": "title_changed",
+ "created_at": 1768114596,
+ "updated_at": 1768114596,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403526220",
+ "part_type": "ticket_attribute_updated_by_admin",
+ "created_at": 1768114679,
+ "updated_at": 1768114679,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false,
+ "updated_attribute_data": {
+ "attribute": {
+ "type": "attribute",
+ "id": "8514185",
+ "label": "Platforms"
+ },
+ "value": {
+ "type": "value",
+ "id": "rewg",
+ "label": "rewg",
+ "previous": ""
+ }
+ }
+ },
+ {
+ "type": "ticket_part",
+ "id": "37404498124",
+ "part_type": "close",
+ "created_at": 1768117266,
+ "updated_at": 1768117266,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37404498160",
+ "part_type": "ticket_state_updated_by_admin",
+ "ticket_state": "resolved",
+ "previous_ticket_state": "submitted",
+ "created_at": 1768117266,
+ "updated_at": 1768117266,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ }
+ ],
+ "total_count": 13
+ },
+ "open": false,
+ "snoozed_until": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "category": "Customer",
+ "is_shared": true,
+ "company_id": null,
+ "channel": "messenger"
+ }
+ },
+ "links": {},
+ "id": "notif_aedb66d9-7147-43ee-8b75-fe3ee2108b11",
+ "topic": "ticket.closed",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768117267,
+ "created_at": 1768117267,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/ticket_conatct_replied.json b/zerver/webhooks/intercom/fixtures/ticket_conatct_replied.json
new file mode 100644
index 00000000000..1f252308f9e
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/ticket_conatct_replied.json
@@ -0,0 +1,284 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "ticket_ticket_part",
+ "ticket": {
+ "type": "ticket",
+ "id": "215472629548109",
+ "ticket_id": "66044663",
+ "ticket_attributes": {
+ "_default_title_": "Unclear customer message received",
+ "_default_description_": "Customer sent an unclear message 'wetewt' and was informed that replies will be sent here and via email at [email protected].",
+ "Platforms": null,
+ "Root cause": null
+ },
+ "ticket_state": {
+ "type": "ticket_state",
+ "id": "4517893",
+ "category": "submitted",
+ "internal_label": "Submitted",
+ "external_label": "Submitted"
+ },
+ "ticket_type": {
+ "type": "ticket_type",
+ "id": "2979330",
+ "name": "Tickets",
+ "description": "When a customer query can’t be instantly resolved, convert to support request ticket to ensure the right details are captured and allow customers to keep track of progress.",
+ "icon": "🎟",
+ "workspace_id": "abc123def",
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651,
+ "is_internal": false,
+ "ticket_type_attributes": {
+ "type": "list",
+ "data": [
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514183",
+ "workspace_id": "abc123def",
+ "name": "_default_title_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 0,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514184",
+ "workspace_id": "abc123def",
+ "name": "_default_description_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": true
+ },
+ "order": 1,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514185",
+ "workspace_id": "abc123def",
+ "name": "Platforms",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 2,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514186",
+ "workspace_id": "abc123def",
+ "name": "Root cause",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 3,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ }
+ ]
+ },
+ "category": "Customer"
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696354ce6b48146fdc536f97",
+ "external_id": "247c49f1-c79e-452d-8afe-b1d38cc0f38a"
+ }
+ ]
+ },
+ "admin_assignee_id": "9608799",
+ "team_assignee_id": "0",
+ "created_at": 1768117469,
+ "updated_at": 1768117506,
+ "ticket_parts": {
+ "type": "ticket_part.list",
+ "ticket_parts": [
+ {
+ "type": "ticket_part",
+ "id": "37404577940",
+ "part_type": "attribute_collected",
+ "created_at": 1768117469,
+ "updated_at": 1768117469,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37404578339",
+ "part_type": "language_detection_details",
+ "created_at": 1768117470,
+ "updated_at": 1768117470,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37404579123",
+ "part_type": "channel_and_reply_time_expectation",
+ "body": "<p>You’ll get replies here and in your email:<br>✉️ <b>[email protected]</b></p>\n<p>The team will reply as soon as they can.</p>",
+ "created_at": 1768117473,
+ "updated_at": 1768117473,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37404587721",
+ "part_type": "ticket_state_updated_by_admin",
+ "ticket_state": "submitted",
+ "previous_ticket_state": "submitted",
+ "created_at": 1768117498,
+ "updated_at": 1768117498,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37404589020",
+ "part_type": "assignment",
+ "body": "<p class=\"no-margin\">sfwa</p>",
+ "created_at": 1768117501,
+ "updated_at": 1768117501,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37404590647",
+ "part_type": "comment",
+ "body": "<p>asfsf</p>",
+ "created_at": 1768117506,
+ "updated_at": 1768117506,
+ "author": {
+ "id": "696354ce6b48146fdc536f97",
+ "type": "user",
+ "name": null,
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ }
+ ],
+ "total_count": 6
+ },
+ "open": true,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "category": "Customer",
+ "is_shared": true,
+ "channel": "messenger"
+ },
+ "ticket_part": {
+ "type": "ticket_part",
+ "id": "37404590647",
+ "part_type": "comment",
+ "body": "<p>asfsf</p>",
+ "created_at": 1768117506,
+ "updated_at": 1768117506,
+ "author": {
+ "id": "696354ce6b48146fdc536f97",
+ "type": "user",
+ "name": null,
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_9d2bc71d-ac2f-4f2d-9a3c-f4213dd933aa",
+ "topic": "ticket.contact.replied",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768117507,
+ "created_at": 1768117507,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/ticket_contact_attached.json b/zerver/webhooks/intercom/fixtures/ticket_contact_attached.json
new file mode 100644
index 00000000000..9db44137a9e
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/ticket_contact_attached.json
@@ -0,0 +1,145 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "ticket": {
+ "type": "ticket",
+ "id": 215472629353977,
+ "url": "https://app.intercom.com/a/apps/abc123def/conversations/215472629353977",
+ "custom_attributes": {
+ "_default_title_": {
+ "value": null,
+ "type": "string"
+ },
+ "_default_description_": {
+ "value": null,
+ "type": "string"
+ },
+ "Platforms": {
+ "value": null,
+ "type": "string"
+ },
+ "Root cause": {
+ "value": null,
+ "type": "string"
+ }
+ },
+ "state": "submitted",
+ "ticket_type": "Tickets",
+ "ticket_type_description": "When a customer query can’t be instantly resolved, convert to support request ticket to ensure the right details are captured and allow customers to keep track of progress.",
+ "ticket_type_emoji": "🎟",
+ "ticket_custom_state_admin_label": "Submitted",
+ "ticket_custom_state_user_label": "Submitted"
+ },
+ "contact": {
+ "type": "contact",
+ "id": "6961e7651f6dbc22dfe148cb",
+ "workspace_id": "abc123def",
+ "external_id": "23",
+ "role": "user",
+ "email": "[email protected]",
+ "phone": null,
+ "formatted_phone": null,
+ "name": "Sample User",
+ "avatar": null,
+ "owner_id": null,
+ "social_profiles": {
+ "type": "list",
+ "data": []
+ },
+ "has_hard_bounced": false,
+ "marked_email_as_spam": false,
+ "unsubscribed_from_emails": false,
+ "created_at": "2026-01-10T05:45:09.945+00:00",
+ "updated_at": "2026-01-10T05:45:09.943+00:00",
+ "signed_up_at": null,
+ "last_seen_at": null,
+ "last_replied_at": null,
+ "last_contacted_at": null,
+ "last_email_opened_at": null,
+ "last_email_clicked_at": null,
+ "language_override": null,
+ "browser": null,
+ "browser_version": null,
+ "browser_language": null,
+ "os": null,
+ "location": {
+ "type": "location",
+ "country": null,
+ "region": null,
+ "city": null,
+ "country_code": null,
+ "continent_code": null
+ },
+ "android_app_name": null,
+ "android_app_version": null,
+ "android_device": null,
+ "android_os_version": null,
+ "android_sdk_version": null,
+ "android_last_seen_at": null,
+ "ios_app_name": null,
+ "ios_app_version": null,
+ "ios_device": null,
+ "ios_os_version": null,
+ "ios_sdk_version": null,
+ "ios_last_seen_at": null,
+ "custom_attributes": {},
+ "tags": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961e7651f6dbc22dfe148cb/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961e7651f6dbc22dfe148cb/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961e7651f6dbc22dfe148cb/companies",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961e7651f6dbc22dfe148cb/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961e7651f6dbc22dfe148cb/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "utm_campaign": null,
+ "utm_content": null,
+ "utm_medium": null,
+ "utm_source": null,
+ "utm_term": null,
+ "referrer": null,
+ "sms_consent": false,
+ "unsubscribed_from_sms": false,
+ "enabled_push_messaging": null
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_b7c34885-5797-4468-b8f8-9fff786bbb7e",
+ "topic": "ticket.contact.attached",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768117724,
+ "created_at": 1768117724,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/ticket_contact_detached.json b/zerver/webhooks/intercom/fixtures/ticket_contact_detached.json
new file mode 100644
index 00000000000..d3e05091764
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/ticket_contact_detached.json
@@ -0,0 +1,145 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "ticket": {
+ "type": "ticket",
+ "id": 215472629353977,
+ "url": "https://app.intercom.com/a/apps/abc123def/conversations/215472629353977",
+ "custom_attributes": {
+ "_default_title_": {
+ "value": null,
+ "type": "string"
+ },
+ "_default_description_": {
+ "value": null,
+ "type": "string"
+ },
+ "Platforms": {
+ "value": null,
+ "type": "string"
+ },
+ "Root cause": {
+ "value": null,
+ "type": "string"
+ }
+ },
+ "state": "submitted",
+ "ticket_type": "Tickets",
+ "ticket_type_description": "When a customer query can’t be instantly resolved, convert to support request ticket to ensure the right details are captured and allow customers to keep track of progress.",
+ "ticket_type_emoji": "🎟",
+ "ticket_custom_state_admin_label": "Submitted",
+ "ticket_custom_state_user_label": "Submitted"
+ },
+ "contact": {
+ "type": "contact",
+ "id": "6961f75992dc9c41aeee94c6",
+ "workspace_id": "abc123def",
+ "external_id": "100",
+ "role": "user",
+ "email": "[email protected]",
+ "phone": null,
+ "formatted_phone": null,
+ "name": "leadu",
+ "avatar": null,
+ "owner_id": null,
+ "social_profiles": {
+ "type": "list",
+ "data": []
+ },
+ "has_hard_bounced": false,
+ "marked_email_as_spam": false,
+ "unsubscribed_from_emails": false,
+ "created_at": "2026-01-10T06:53:13.684+00:00",
+ "updated_at": "2026-01-11T07:48:44.707+00:00",
+ "signed_up_at": null,
+ "last_seen_at": null,
+ "last_replied_at": null,
+ "last_contacted_at": "2026-01-11T07:48:44.000+00:00",
+ "last_email_opened_at": null,
+ "last_email_clicked_at": null,
+ "language_override": null,
+ "browser": null,
+ "browser_version": null,
+ "browser_language": null,
+ "os": null,
+ "location": {
+ "type": "location",
+ "country": null,
+ "region": null,
+ "city": null,
+ "country_code": null,
+ "continent_code": null
+ },
+ "android_app_name": null,
+ "android_app_version": null,
+ "android_device": null,
+ "android_os_version": null,
+ "android_sdk_version": null,
+ "android_last_seen_at": null,
+ "ios_app_name": null,
+ "ios_app_version": null,
+ "ios_device": null,
+ "ios_os_version": null,
+ "ios_sdk_version": null,
+ "ios_last_seen_at": null,
+ "custom_attributes": {},
+ "tags": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961f75992dc9c41aeee94c6/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961f75992dc9c41aeee94c6/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961f75992dc9c41aeee94c6/companies",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961f75992dc9c41aeee94c6/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961f75992dc9c41aeee94c6/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "utm_campaign": null,
+ "utm_content": null,
+ "utm_medium": null,
+ "utm_source": null,
+ "utm_term": null,
+ "referrer": null,
+ "sms_consent": false,
+ "unsubscribed_from_sms": false,
+ "enabled_push_messaging": null
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_bce453db-05b4-4d76-b58b-a2e72362711f",
+ "topic": "ticket.contact.detached",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768117767,
+ "created_at": 1768117767,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/ticket_created.json b/zerver/webhooks/intercom/fixtures/ticket_created.json
new file mode 100644
index 00000000000..0d71481a411
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/ticket_created.json
@@ -0,0 +1,231 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "ticket",
+ "id": "215472629311235",
+ "ticket_id": "66040342",
+ "ticket_attributes": {
+ "_default_title_": "Unclear user message 'erf' with pending email response",
+ "_default_description_": "User sent an unclear message 'erf' and was informed that replies will be sent here and to [email protected]; awaiting further clarification or response.",
+ "Platforms": null,
+ "Root cause": null
+ },
+ "ticket_state": {
+ "type": "ticket_state",
+ "id": "4517893",
+ "category": "submitted",
+ "internal_label": "Submitted",
+ "external_label": "Submitted"
+ },
+ "ticket_type": {
+ "type": "ticket_type",
+ "id": "2979330",
+ "name": "Tickets",
+ "description": "When a customer query can’t be instantly resolved, convert to support request ticket to ensure the right details are captured and allow customers to keep track of progress.",
+ "icon": "🎟",
+ "workspace_id": "abc123def",
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651,
+ "is_internal": false,
+ "ticket_type_attributes": {
+ "type": "list",
+ "data": [
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514183",
+ "workspace_id": "abc123def",
+ "name": "_default_title_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 0,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514184",
+ "workspace_id": "abc123def",
+ "name": "_default_description_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": true
+ },
+ "order": 1,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514185",
+ "workspace_id": "abc123def",
+ "name": "Platforms",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 2,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514186",
+ "workspace_id": "abc123def",
+ "name": "Root cause",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 3,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ }
+ ]
+ },
+ "category": "Customer"
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696346bbaebb5a479d3851a3",
+ "external_id": "f7c0bc1e-5ee2-46a0-b11a-ea473d1101a5"
+ }
+ ]
+ },
+ "admin_assignee_id": "0",
+ "team_assignee_id": "0",
+ "created_at": 1768113868,
+ "updated_at": 1768114250,
+ "ticket_parts": {
+ "type": "ticket_part.list",
+ "ticket_parts": [
+ {
+ "type": "ticket_part",
+ "id": "37403241257",
+ "part_type": "attribute_collected",
+ "created_at": 1768113868,
+ "updated_at": 1768113868,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403241627",
+ "part_type": "language_detection_details",
+ "created_at": 1768113869,
+ "updated_at": 1768113869,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403242516",
+ "part_type": "channel_and_reply_time_expectation",
+ "body": "<p>You’ll get replies here and in your email:<br>✉️ <b>[email protected]</b></p>\n<p>The team will reply as soon as they can.</p>",
+ "created_at": 1768113872,
+ "updated_at": 1768113872,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403374462",
+ "part_type": "ticket_state_updated_by_admin",
+ "ticket_state": "submitted",
+ "previous_ticket_state": "submitted",
+ "created_at": 1768114250,
+ "updated_at": 1768114250,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ }
+ ],
+ "total_count": 4
+ },
+ "open": true,
+ "snoozed_until": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "category": "Customer",
+ "is_shared": true,
+ "company_id": null,
+ "channel": "messenger"
+ }
+ },
+ "links": {},
+ "id": "notif_381b4609-2b35-4720-8389-605f220e402a",
+ "topic": "ticket.created",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768114251,
+ "created_at": 1768114251,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/ticket_note_created.json b/zerver/webhooks/intercom/fixtures/ticket_note_created.json
new file mode 100644
index 00000000000..fbc17b9272a
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/ticket_note_created.json
@@ -0,0 +1,253 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "ticket_ticket_part",
+ "ticket": {
+ "type": "ticket",
+ "id": "215472629353977",
+ "ticket_id": "66040991",
+ "ticket_attributes": {
+ "_default_title_": null,
+ "_default_description_": null,
+ "Platforms": null,
+ "Root cause": null
+ },
+ "ticket_state": {
+ "type": "ticket_state",
+ "id": "4517893",
+ "category": "submitted",
+ "internal_label": "Submitted",
+ "external_label": "Submitted"
+ },
+ "ticket_type": {
+ "type": "ticket_type",
+ "id": "2979330",
+ "name": "Tickets",
+ "description": "When a customer query can’t be instantly resolved, convert to support request ticket to ensure the right details are captured and allow customers to keep track of progress.",
+ "icon": "🎟",
+ "workspace_id": "abc123def",
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651,
+ "is_internal": false,
+ "ticket_type_attributes": {
+ "type": "list",
+ "data": [
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514183",
+ "workspace_id": "abc123def",
+ "name": "_default_title_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 0,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514184",
+ "workspace_id": "abc123def",
+ "name": "_default_description_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": true
+ },
+ "order": 1,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514185",
+ "workspace_id": "abc123def",
+ "name": "Platforms",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 2,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514186",
+ "workspace_id": "abc123def",
+ "name": "Root cause",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 3,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ }
+ ]
+ },
+ "category": "Customer"
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "6961f75992dc9c41aeee94c6",
+ "external_id": "100"
+ }
+ ]
+ },
+ "admin_assignee_id": "9608799",
+ "team_assignee_id": "0",
+ "created_at": 1768114809,
+ "updated_at": 1768117318,
+ "ticket_parts": {
+ "type": "ticket_part.list",
+ "ticket_parts": [
+ {
+ "type": "ticket_part",
+ "id": "37403575650",
+ "part_type": "assignment",
+ "created_at": 1768114810,
+ "updated_at": 1768114810,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403575955",
+ "part_type": "ticket_state_updated_by_admin",
+ "ticket_state": "submitted",
+ "previous_ticket_state": "submitted",
+ "created_at": 1768114810,
+ "updated_at": 1768114810,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403591177",
+ "part_type": "comment",
+ "body": "<p class=\"no-margin\">hgjvjh</p>",
+ "created_at": 1768114835,
+ "updated_at": 1768114835,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37404518759",
+ "part_type": "note",
+ "body": "<p class=\"no-margin\">agd</p>",
+ "created_at": 1768117318,
+ "updated_at": 1768117318,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ }
+ ],
+ "total_count": 4
+ },
+ "open": true,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "category": "Customer",
+ "is_shared": true,
+ "channel": "messenger"
+ },
+ "ticket_part": {
+ "type": "ticket_part",
+ "id": "37404518759",
+ "part_type": "note",
+ "body": "<p class=\"no-margin\">agd</p>",
+ "created_at": 1768117318,
+ "updated_at": 1768117318,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_83b0ce3c-7c9c-4125-911d-16679ad38f1e",
+ "topic": "ticket.note.created",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768117319,
+ "created_at": 1768117319,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/ticket_state_updated.json b/zerver/webhooks/intercom/fixtures/ticket_state_updated.json
new file mode 100644
index 00000000000..71f6d3b4b9a
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/ticket_state_updated.json
@@ -0,0 +1,231 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "ticket",
+ "id": "215472629311235",
+ "ticket_id": "66040342",
+ "ticket_attributes": {
+ "_default_title_": "Unclear user message 'erf' with pending email response",
+ "_default_description_": "User sent an unclear message 'erf' and was informed that replies will be sent here and to [email protected]; awaiting further clarification or response.",
+ "Platforms": null,
+ "Root cause": null
+ },
+ "ticket_state": {
+ "type": "ticket_state",
+ "id": "4517893",
+ "category": "submitted",
+ "internal_label": "Submitted",
+ "external_label": "Submitted"
+ },
+ "ticket_type": {
+ "type": "ticket_type",
+ "id": "2979330",
+ "name": "Tickets",
+ "description": "When a customer query can’t be instantly resolved, convert to support request ticket to ensure the right details are captured and allow customers to keep track of progress.",
+ "icon": "🎟",
+ "workspace_id": "abc123def",
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651,
+ "is_internal": false,
+ "ticket_type_attributes": {
+ "type": "list",
+ "data": [
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514183",
+ "workspace_id": "abc123def",
+ "name": "_default_title_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 0,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514184",
+ "workspace_id": "abc123def",
+ "name": "_default_description_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": true
+ },
+ "order": 1,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514185",
+ "workspace_id": "abc123def",
+ "name": "Platforms",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 2,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514186",
+ "workspace_id": "abc123def",
+ "name": "Root cause",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 3,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ }
+ ]
+ },
+ "category": "Customer"
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696346bbaebb5a479d3851a3",
+ "external_id": "f7c0bc1e-5ee2-46a0-b11a-ea473d1101a5"
+ }
+ ]
+ },
+ "admin_assignee_id": "0",
+ "team_assignee_id": "0",
+ "created_at": 1768113868,
+ "updated_at": 1768114250,
+ "ticket_parts": {
+ "type": "ticket_part.list",
+ "ticket_parts": [
+ {
+ "type": "ticket_part",
+ "id": "37403241257",
+ "part_type": "attribute_collected",
+ "created_at": 1768113868,
+ "updated_at": 1768113868,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403241627",
+ "part_type": "language_detection_details",
+ "created_at": 1768113869,
+ "updated_at": 1768113869,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403242516",
+ "part_type": "channel_and_reply_time_expectation",
+ "body": "<p>You’ll get replies here and in your email:<br>✉️ <b>[email protected]</b></p>\n<p>The team will reply as soon as they can.</p>",
+ "created_at": 1768113872,
+ "updated_at": 1768113872,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403374462",
+ "part_type": "ticket_state_updated_by_admin",
+ "ticket_state": "submitted",
+ "previous_ticket_state": "submitted",
+ "created_at": 1768114250,
+ "updated_at": 1768114250,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ }
+ ],
+ "total_count": 4
+ },
+ "open": true,
+ "snoozed_until": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "category": "Customer",
+ "is_shared": true,
+ "company_id": null,
+ "channel": "messenger"
+ }
+ },
+ "links": {},
+ "id": "notif_ee8078c0-9021-4db6-bb63-b883579849ce",
+ "topic": "ticket.state.updated",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768114251,
+ "created_at": 1768114250,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/ticket_team_assigned.json b/zerver/webhooks/intercom/fixtures/ticket_team_assigned.json
new file mode 100644
index 00000000000..7001c51e9f3
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/ticket_team_assigned.json
@@ -0,0 +1,289 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "ticket_ticket_part",
+ "ticket": {
+ "type": "ticket",
+ "id": "215472629311235",
+ "ticket_id": "66040342",
+ "ticket_attributes": {
+ "_default_title_": "Unclear user message 'erf' with pending email response",
+ "_default_description_": "User sent an unclear message 'erf' and was informed that replies will be sent here and to [email protected]; awaiting further clarification or response.",
+ "Platforms": null,
+ "Root cause": null
+ },
+ "ticket_state": {
+ "type": "ticket_state",
+ "id": "4517893",
+ "category": "submitted",
+ "internal_label": "Submitted",
+ "external_label": "Submitted"
+ },
+ "ticket_type": {
+ "type": "ticket_type",
+ "id": "2979330",
+ "name": "Tickets",
+ "description": "When a customer query can’t be instantly resolved, convert to support request ticket to ensure the right details are captured and allow customers to keep track of progress.",
+ "icon": "🎟",
+ "workspace_id": "abc123def",
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651,
+ "is_internal": false,
+ "ticket_type_attributes": {
+ "type": "list",
+ "data": [
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514183",
+ "workspace_id": "abc123def",
+ "name": "_default_title_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 0,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514184",
+ "workspace_id": "abc123def",
+ "name": "_default_description_",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": true
+ },
+ "order": 1,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": true,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514185",
+ "workspace_id": "abc123def",
+ "name": "Platforms",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 2,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ },
+ {
+ "type": "ticket_type_attribute",
+ "id": "8514186",
+ "workspace_id": "abc123def",
+ "name": "Root cause",
+ "description": "",
+ "data_type": "string",
+ "input_options": {
+ "multiline": false
+ },
+ "order": 3,
+ "required_to_create": false,
+ "required_to_create_for_contacts": false,
+ "visible_on_create": true,
+ "visible_to_contacts": true,
+ "default": false,
+ "ticket_type_id": 2979330,
+ "archived": false,
+ "created_at": 1767066651,
+ "updated_at": 1767066651
+ }
+ ]
+ },
+ "category": "Customer"
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696346bbaebb5a479d3851a3",
+ "external_id": "f7c0bc1e-5ee2-46a0-b11a-ea473d1101a5"
+ }
+ ]
+ },
+ "admin_assignee_id": "0",
+ "team_assignee_id": "9680998",
+ "created_at": 1768113868,
+ "updated_at": 1768114432,
+ "ticket_parts": {
+ "type": "ticket_part.list",
+ "ticket_parts": [
+ {
+ "type": "ticket_part",
+ "id": "37403241257",
+ "part_type": "attribute_collected",
+ "created_at": 1768113868,
+ "updated_at": 1768113868,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403241627",
+ "part_type": "language_detection_details",
+ "created_at": 1768113869,
+ "updated_at": 1768113869,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403242516",
+ "part_type": "channel_and_reply_time_expectation",
+ "body": "<p>You’ll get replies here and in your email:<br>✉️ <b>[email protected]</b></p>\n<p>The team will reply as soon as they can.</p>",
+ "created_at": 1768113872,
+ "updated_at": 1768113872,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403374462",
+ "part_type": "ticket_state_updated_by_admin",
+ "ticket_state": "submitted",
+ "previous_ticket_state": "submitted",
+ "created_at": 1768114250,
+ "updated_at": 1768114250,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403424009",
+ "part_type": "assignment",
+ "created_at": 1768114389,
+ "updated_at": 1768114389,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ },
+ {
+ "type": "ticket_part",
+ "id": "37403439476",
+ "part_type": "assignment",
+ "created_at": 1768114432,
+ "updated_at": 1768114432,
+ "assigned_to": {
+ "type": "team",
+ "id": "9680998"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ }
+ ],
+ "total_count": 6
+ },
+ "open": true,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "category": "Customer",
+ "is_shared": true,
+ "channel": "messenger"
+ },
+ "ticket_part": {
+ "type": "ticket_part",
+ "id": "37403439476",
+ "part_type": "assignment",
+ "created_at": 1768114432,
+ "updated_at": 1768114432,
+ "assigned_to": {
+ "type": "team",
+ "id": "9680998"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "redacted": false
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_a8efed29-f320-487a-860a-039843aec89e",
+ "topic": "ticket.team.assigned",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768114433,
+ "created_at": 1768114433,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/view.py b/zerver/webhooks/intercom/view.py
index 8c4eabdb8bb..13fc9ed09f3 100644
--- a/zerver/webhooks/intercom/view.py
+++ b/zerver/webhooks/intercom/view.py
@@ -26,6 +26,7 @@ IGNORED_EVENTS = [
# Unable to invoke these events, likely restricted for trial accounts.
*[
"conversation.rating.added",
+ "ticket.rating.provided",
],
]