From 20105edbcb712a459b958a679f92b197ec185c9d Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Wed, 6 May 2026 15:54:39 -0600 Subject: [PATCH] Include id in linked-issue JSON exports Add id to the GraphQL fragment for subIssues, blockedBy, and blocking nodes so the canonical node identifier is fetched, and surface it in the JSON output alongside number/title/url/state for parent, subIssues, blockedBy, and blocking. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- api/export_pr.go | 4 ++++ api/query_builder.go | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api/export_pr.go b/api/export_pr.go index f5592befd..454a4e05c 100644 --- a/api/export_pr.go +++ b/api/export_pr.go @@ -51,6 +51,7 @@ func (issue *Issue) ExportData(fields []string) map[string]interface{} { case "parent": if issue.Parent != nil { data[f] = map[string]interface{}{ + "id": issue.Parent.ID, "number": issue.Parent.Number, "title": issue.Parent.Title, "url": issue.Parent.URL, @@ -63,6 +64,7 @@ func (issue *Issue) ExportData(fields []string) map[string]interface{} { items := make([]map[string]interface{}, 0, len(issue.SubIssues.Nodes)) for _, n := range issue.SubIssues.Nodes { items = append(items, map[string]interface{}{ + "id": n.ID, "number": n.Number, "title": n.Title, "url": n.URL, @@ -80,6 +82,7 @@ func (issue *Issue) ExportData(fields []string) map[string]interface{} { items := make([]map[string]interface{}, 0, len(issue.BlockedBy.Nodes)) for _, n := range issue.BlockedBy.Nodes { items = append(items, map[string]interface{}{ + "id": n.ID, "number": n.Number, "title": n.Title, "url": n.URL, @@ -91,6 +94,7 @@ func (issue *Issue) ExportData(fields []string) map[string]interface{} { items := make([]map[string]interface{}, 0, len(issue.Blocking.Nodes)) for _, n := range issue.Blocking.Nodes { items = append(items, map[string]interface{}{ + "id": n.ID, "number": n.Number, "title": n.Title, "url": n.URL, diff --git a/api/query_builder.go b/api/query_builder.go index ad69b9598..63c61cb45 100644 --- a/api/query_builder.go +++ b/api/query_builder.go @@ -447,13 +447,13 @@ func IssueGraphQL(fields []string) string { case "parent": q = append(q, `parent{id,number,title,url,state,repository{nameWithOwner}}`) case "subIssues": - q = append(q, `subIssues(first:50){nodes{number,title,url,state,repository{nameWithOwner}},totalCount}`) + q = append(q, `subIssues(first:50){nodes{id,number,title,url,state,repository{nameWithOwner}},totalCount}`) case "subIssuesSummary": q = append(q, `subIssuesSummary{total,completed,percentCompleted}`) case "blockedBy": - q = append(q, `blockedBy(first:50){nodes{number,title,url,state,repository{nameWithOwner}}}`) + q = append(q, `blockedBy(first:50){nodes{id,number,title,url,state,repository{nameWithOwner}}}`) case "blocking": - q = append(q, `blocking(first:50){nodes{number,title,url,state,repository{nameWithOwner}}}`) + q = append(q, `blocking(first:50){nodes{id,number,title,url,state,repository{nameWithOwner}}}`) default: q = append(q, field) }