Skip to content

feat: globalId for remote links - #1012

Open
danepowell wants to merge 1 commit into
ankitpokhrel:mainfrom
danepowell:globalId
Open

danepowell wants to merge 1 commit into
ankitpokhrel:mainfrom
danepowell:globalId

Conversation

@danepowell

Copy link
Copy Markdown

The issue remote link API supports a globalID parameter that allows for updating an existing remote link: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-remote-links/#api-rest-api-3-issue-issueidorkey-remotelink-post

This also makes requests idempotent, which is critical when using the CLI in a CI environment where you want to avoid creating duplicate issue links.

Copilot AI review requested due to automatic review settings July 31, 2026 16:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for Jira remote link globalId so the CLI can create-or-update (idempotently) an issue remote link instead of creating duplicates鈥攗seful for CI usage.

Changes:

  • Add globalId to the remote link request payload and thread it through Client.RemoteLinkIssue.
  • Expose --global-id flag on jira issue link remote and pass it to the Jira client.
  • Update tests and README examples to cover the new parameter.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
README.md Documents --global-id usage and cleans up releases section formatting.
pkg/jira/issue.go Adds globalId JSON field and extends RemoteLinkIssue to accept it.
pkg/jira/issue_test.go Validates request body includes/omits globalId depending on input.
internal/cmd/issue/link/remote/remote.go Adds --global-id flag and passes it through to the client call.

馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/jira/issue.go

// RemoteLinkIssue adds a remote link to an issue using POST /issue/{issueId}/remotelink endpoint.
func (c *Client) RemoteLinkIssue(issueID, title, url string) error {
func (c *Client) RemoteLinkIssue(issueID, title, url, globalID string) error {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread pkg/jira/issue.go

// RemoteLinkIssue adds a remote link to an issue using POST /issue/{issueId}/remotelink endpoint.
func (c *Client) RemoteLinkIssue(issueID, title, url string) error {
func (c *Client) RemoteLinkIssue(issueID, title, url, globalID string) error {
Comment thread pkg/jira/issue_test.go
Comment on lines +716 to 717
err = client.RemoteLinkIssue("TEST-1", "weblink title", "https://weblink.com", "")
assert.Error(t, &ErrUnexpectedResponse{}, err)
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