Skip to content

feat: sync GitHub PR links to Jira Git Pull Request field#48

Open
evwilkin wants to merge 2 commits into
rh-uxd:mainfrom
evwilkin:chore/47-pr-links
Open

feat: sync GitHub PR links to Jira Git Pull Request field#48
evwilkin wants to merge 2 commits into
rh-uxd:mainfrom
evwilkin:chore/47-pr-links

Conversation

@evwilkin

@evwilkin evwilkin commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fetches closedByPullRequestsReferences from GitHub GraphQL for all issues and sub-issues
  • Populates Jira custom field customfield_10875 ("Git Pull Request") as ADF with PR URLs, one per line
  • Skips unnecessary Jira writes when PR links haven't changed since last sync
  • Covers both create and update paths, including child issues

Closes #47

Screenshot of what implementation looks like, using this PR to update the Jira for the original Github issue #47:
Screenshot 2026-07-09 at 10 12 41 AM

Test plan

  • npm test passes (135 tests)
  • Run sync against a repo with issues that have linked PRs — verify customfield_10875 populated in Jira
  • Re-run sync — verify no unnecessary updates when PRs unchanged

🤖 Assisted by Claude Code

evwilkin and others added 2 commits July 8, 2026 17:34
Populates customfield_10875 ("Git Pull Request") on synced Jira issues
with URLs of PRs that close/reference each GitHub issue, so users can
navigate directly from Jira to a PR without clicking through GitHub.

- Add closedByPullRequestsReferences to all GraphQL queries
- Set customfield_10875 as ADF on create and update
- Skip field write when PR links unchanged between syncs
- Fetch customfield_10875 in open-issues query for comparison
- Add tests covering ADF structure, no-PR omission, missing field

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two improvements to the Git Pull Request field sync (customfield_10875):

1. PR-driven sync: fetch recently-updated PRs per repo and update Jira
   issues they close, catching cases where a linked issue's updatedAt
   is not bumped when a PR is opened against it.

2. inlineCard ADF nodes: write PR URLs as Jira smart-link chips instead
   of plain text, so the field renders with title, status badge, and
   hover card without any manual interaction.

Also adds extractTextFromADF support for inlineCard nodes so the change-
detection comparison in updateJiraIssue stays stable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@evwilkin evwilkin requested a review from nicolethoen July 9, 2026 14:18
@evwilkin

evwilkin commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@nicolethoen this covers a request from Eric to add PR links to the Jira issues, and uses the existing "Git Pull Request" field in the Jira issue to capture this. Requesting you here for any feedback before adding this feature.

Quick summary, in addition to checking recently-updated Github & Jira issues we now also check recently-updated PRs from Github; unfortunately linking a PR to an issue in Github doesn't cause that issue to be flagged as recently updated so this is an entirely new check & API endpoint we're hitting.

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.

Sync linked PRs

1 participant