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.

linear: Ignore Comment events fired for comments on Documents.

Dhruv Shettya34579748d02
diff --git a/zerver/webhooks/linear/doc.md b/zerver/webhooks/linear/doc.md
index c023b68f562..2177b31972c 100644
--- a/zerver/webhooks/linear/doc.md
+++ b/zerver/webhooks/linear/doc.md
@@ -23,6 +23,11 @@ Get Linear notifications in Zulip!
{!event-filtering-additional-feature.md!}
+!!! warn ""
+
+ **Note**: `comment` events are only supported for comments on
+ issues. Comments on Linear documents do not trigger notifications.
+
### Related documentation
- [Linear webhook events documentation][linear-webhooks]
diff --git a/zerver/webhooks/linear/fixtures/comment_on_document.json b/zerver/webhooks/linear/fixtures/comment_on_document.json
new file mode 100644
index 00000000000..cda7881bbff
--- /dev/null
+++ b/zerver/webhooks/linear/fixtures/comment_on_document.json
@@ -0,0 +1,34 @@
+{
+ "action": "create",
+ "actor": {
+ "id": "e825c109-f691-4716-a85f-b68a2626531c",
+ "name": "Dhruv Shetty",
+ "email": "[email protected]",
+ "url": "https://linear.app/zulipdhruv/profiles/dhruv",
+ "type": "user"
+ },
+ "createdAt": "2026-05-19T13:08:19.956Z",
+ "data": {
+ "id": "e3ff103c-53ac-4267-bdfc-cd05f7e49dc7",
+ "createdAt": "2026-05-19T13:08:19.956Z",
+ "updatedAt": "2026-05-19T13:08:19.927Z",
+ "body": "This is an comment on a Document",
+ "documentContentId": "49567929-242f-43b6-a7bf-193744e4279a",
+ "userId": "e825c109-f691-4716-a85f-b68a2626531c",
+ "quotedText": "This is an comment",
+ "reactionData": [],
+ "isArtificialAgentSessionRoot": false,
+ "botActor": null,
+ "user": {
+ "id": "e825c109-f691-4716-a85f-b68a2626531c",
+ "name": "Dhruv Shetty",
+ "email": "[email protected]",
+ "url": "https://linear.app/zulipdhruv/profiles/dhruv"
+ }
+ },
+ "url": "https://linear.app/zulipdhruv/document/hello-ddb80e78e24b#comment-e3ff103c",
+ "type": "Comment",
+ "organizationId": "498d97b2-c819-42cc-8d65-7bffd494ed23",
+ "webhookTimestamp": 1779196118345,
+ "webhookId": "a9d5653b-3026-4030-9c0e-ac964e3bb507"
+}
diff --git a/zerver/webhooks/linear/tests.py b/zerver/webhooks/linear/tests.py
index f8a9a79585f..2ab07d3fc28 100644
--- a/zerver/webhooks/linear/tests.py
+++ b/zerver/webhooks/linear/tests.py
@@ -79,3 +79,12 @@ class LinearHookTests(WebhookTestCase):
content_type="application/json",
)
self.assert_json_success(result)
+
+ def test_comment_on_document(self) -> None:
+ payload = self.get_body("comment_on_document")
+ result = self.client_post(
+ self.url,
+ payload,
+ content_type="application/json",
+ )
+ self.assert_json_success(result)
diff --git a/zerver/webhooks/linear/view.py b/zerver/webhooks/linear/view.py
index f13c83cd983..9601d7c6a18 100644
--- a/zerver/webhooks/linear/view.py
+++ b/zerver/webhooks/linear/view.py
@@ -154,7 +154,9 @@ def get_event_type(payload: WildValue) -> str | None:
has_parent_id = "parentId" in payload["data"]
return "issue" if not has_parent_id else "sub_issue"
elif event_type == "Comment":
- return "comment"
+ # Document comments also arrive as Comment events but carry
+ # no nested issue object to route a topic to.
+ return "comment" if "issue" in payload["data"] else None
elif event_type in IGNORED_EVENTS:
return None