Skip to content

fix(integrations): Ignore commit links in external issue group lookup - #128497

Draft
vaind wants to merge 1 commit into
masterfrom
ivan/fix/external-issue-group-lookup-ignores-commit-links
Draft

vaind wants to merge 1 commit into
masterfrom
ivan/fix/external-issue-group-lookup-ignores-commit-links

Conversation

@vaind

@vaind vaind commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

A GroupLink row ties an issue in Sentry (a group) to something outside it: a ticket in an issue tracker (stored as an ExternalIssue, such as a Jira ticket), a commit, or a pull request. linked_id holds the id of the linked row and linked_type says which kind of row that is. Commits and external issues are numbered independently, so a commit id can equal an ExternalIssue id.

Group.objects.get_groups_by_external_issue finds the groups linked to a tracker ticket by matching linked_id against the ticket's ExternalIssue ids, but never checks linked_type. So a group that only references a commit with that same id is returned too. Inbound status and assignee sync (Jira, GitHub, GitLab, Azure DevOps) then resolves or reassigns that unrelated group, and the Jira issue panel lists it. Since #126011 scoped the lookup by organization, the stray group is always in the same organization.

The fix adds linked_type=issue to the GroupLink filter. The existing (linked_id, linked_type) index covers both conditions; the query plan uses it with both as the index condition.

#126319 fixes the same mix-up in Project.transfer_to.

GroupLink.linked_id holds an ExternalIssue id for issue links but a Commit id for commit
links. get_groups_by_external_issue matched on linked_id alone, so a group whose commit link
happened to share an id with the synced ExternalIssue was returned as well. Inbound status
and assignee sync and the Jira issue panel then acted on that unrelated group in the same
organization.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant