Skip to content

: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.

fix(conversations): show the real author of a github ticket comment (#100302)

posthog[bot]a93687d42fcd
diff --git a/products/conversations/backend/api/tests/test_tickets.py b/products/conversations/backend/api/tests/test_tickets.py
index c20a804cee5f..a597ff7dbdb1 100644
--- a/products/conversations/backend/api/tests/test_tickets.py
+++ b/products/conversations/backend/api/tests/test_tickets.py
@@ -2561,6 +2561,13 @@ class TestTicketMessagesAPI(APIBaseTest):
{"slack_author_name": "Chris"},
"Chris",
),
+ (
+ "github_comment_author",
+ {"name": "Mark"},
+ "customer",
+ {"from_github": True, "github_login": "chris"},
+ "chris",
+ ),
(
"zendesk_import_author",
{"name": "Mark"},
diff --git a/products/conversations/backend/api/tickets.py b/products/conversations/backend/api/tickets.py
index c5d987fbecb8..066f844ac4d2 100644
--- a/products/conversations/backend/api/tickets.py
+++ b/products/conversations/backend/api/tickets.py
@@ -1389,6 +1389,7 @@ class TicketViewSet(TaggedItemViewSetMixin, TeamAndOrgViewSetMixin, AccessContro
or item_context.get("slack_author_name")
or item_context.get("teams_author_name")
or item_context.get("teams_author_email")
+ or item_context.get("github_login")
or item_context.get("email_from_name")
)
diff --git a/products/conversations/backend/facade/api.py b/products/conversations/backend/facade/api.py
index 9a29025c7a91..e70f24b10773 100644
--- a/products/conversations/backend/facade/api.py
+++ b/products/conversations/backend/facade/api.py
@@ -338,6 +338,7 @@ def _support_ticket_last_message(ticket: Ticket, comment: Comment | None) -> Con
"slack_author_name",
"teams_author_name",
"teams_author_email",
+ "github_login",
"email_from_name",
"slack_author_email",
"email_from",
diff --git a/products/conversations/backend/tests/test_facade.py b/products/conversations/backend/tests/test_facade.py
index f1f29b0e5e4f..23303502c161 100644
--- a/products/conversations/backend/tests/test_facade.py
+++ b/products/conversations/backend/tests/test_facade.py
@@ -1,4 +1,5 @@
from datetime import UTC, datetime, timedelta
+from typing import Any
from uuid import UUID, uuid4
from posthog.test.base import BaseTest
@@ -222,6 +223,13 @@ class TestListAccountTickets(BaseTest):
"Teams responder",
),
+ (
+ # GitHub gives no per-comment email, so the address stays the ticket requester's.
+ "github",
+ {"author_type": "customer", "from_github": True, "github_login": "github-responder"},
+ "github-responder",
+ ),
(
"email",
{"author_type": "customer", "email_from_name": "Email responder", "email_from": "[email protected]"},
@@ -233,9 +241,9 @@ class TestListAccountTickets(BaseTest):
def test_returns_channel_specific_inbound_sender(
self,
_name: str,
- item_context: dict[str, str],
+ item_context: dict[str, Any],
expected_name: str,
- expected_email: str,
+ expected_email: str | None,
) -> None:
ticket = self._create_ticket(
team=self.team,
diff --git a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.test.ts b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.test.ts
index 215aec86b5fb..5670d0c42b17 100644
--- a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.test.ts
+++ b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.test.ts
@@ -241,6 +241,7 @@ describe('supportTicketSceneLogic chatMessages mapping', () => {
test.each<[string, Record<string, any>, string]>([
['teams thread reply author', { teams_author_name: 'Chris' }, 'Chris'],
['slack thread reply author', { slack_author_name: 'Chris' }, 'Chris'],
+ ['github comment author', { from_github: true, github_login: 'chris' }, 'chris'],
['requester fallback without per-message author', {}, 'Mark'],
])('%s', (_name, itemContext, expectedName) => {
logic.actions.setMessages([makeCustomerComment('msg-1', itemContext)])
diff --git a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts
index af0a3dc05a63..0b5b62f80b60 100644
--- a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts
+++ b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts
@@ -1060,6 +1060,7 @@ export const supportTicketSceneLogic = kea<supportTicketSceneLogicType>([
message.item_context?.slack_author_name ||
message.item_context?.teams_author_name ||
message.item_context?.teams_author_email ||
+ message.item_context?.github_login ||
message.item_context?.email_from_name
if (messageAuthorName) {
displayName = messageAuthorName