feat: globalId for remote links - #1012
Open
danepowell wants to merge 1 commit into
Open
danepowell wants to merge 1 commit into
danepowell wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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
globalIdto the remote link request payload and thread it throughClient.RemoteLinkIssue. - Expose
--global-idflag onjira issue link remoteand 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.
|
|
||
| // 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 { |
Author
There was a problem hiding this comment.
|
|
||
| // 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 on lines
+716
to
717
| err = client.RemoteLinkIssue("TEST-1", "weblink title", "https://weblink.com", "") | ||
| assert.Error(t, &ErrUnexpectedResponse{}, err) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.