Skip to content

Handle GitHub issues transferred between repositories (RDT-1268) (SRV-176)#118

Draft
Copilot wants to merge 3 commits intov1from
copilot/rdt-1268-handle-issues-transferred
Draft

Handle GitHub issues transferred between repositories (RDT-1268) (SRV-176)#118
Copilot wants to merge 3 commits intov1from
copilot/rdt-1268-handle-issues-transferred

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 27, 2026

When a GitHub issue is transferred between repos, both the source and destination sync actions run independently—resulting in two Jira issues for the same GitHub issue, with both keys appended to the title (e.g., Title (IEP-123) (IDFGH-456)).

Changes

sync_issue.py — new handle_issue_transferred()

Handles the issues:transferred webhook event fired in the source repo:

  • Finds the existing Jira issue via the old GitHub URL's remote link
  • Updates the remote link globalId to the new GitHub URL so the destination repo's sync action can find it by URL lookup (preventing duplicate creation in the happy path)
  • Updates the Jira issue summary and description to reflect the new issue number/URL
  • Leaves a Jira comment documenting source → destination transfer

sync_issue.py — modified _find_jira_issue()

Adds a transfer detection fallback for the destination repo to handle the race condition where opened fires before the source repo's transferred handler has run:

When no Jira issue is found by URL, and the GitHub title contains a Jira key (e.g., (IEP-123)), the existing manual-sync logic already checks if IEP-123 exists. This now also checks if that issue has a synced from remote link starting with https://github.com/—indicating a previously synced issue from another repo. If detected, the remote link is updated to the new URL and the existing issue is returned, skipping creation.

sync_to_jira.py

Registers handle_issue_transferred under the issues:transferred action in the dispatch table.

Tests

Six new tests covering: remote link update, graceful no-ops for missing Jira issue or missing new_issue payload, transfer detection in _find_jira_issue, duplicate prevention in handle_issue_opened, and routing of the transferred event.


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI changed the title [WIP] Handle issues transferred between projects Handle GitHub issues transferred between repositories (RDT-1268) Mar 27, 2026
Copilot AI requested a review from kumekay March 27, 2026 10:56
@github-actions github-actions bot changed the title Handle GitHub issues transferred between repositories (RDT-1268) Handle GitHub issues transferred between repositories (RDT-1268) (SRV-176) Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants