This resource represents remote issue links, a way of linking Jira to information in other systems. Use it to get, create, update, and delete remote issue links either by ID or global ID. The global ID provides a way of accessing remote issue links using information about the item's remote system host and remote system identifier.
Get remote issue links
GET /rest/api/{2-3}/issue/{issueIdOrKey}/remotelink
Gets returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that global ID is returned, otherwise all remote issue links are returned.
Where a global ID includes reserved URL characters these must be escaped in the request.
package main
import (
"context"
"fmt"
v2 "github.com/ctreminiom/go-atlassian/v2/jira/v2"
"log"
"os"
)
func main() {
var (
host = os.Getenv("HOST")
mail = os.Getenv("MAIL")
token = os.Getenv("TOKEN")
)
instance, err := v2.New(nil, host)
if err != nil {
log.Fatal(err)
}
instance.Auth.SetBasicAuth(mail, token)
instance.Auth.SetUserAgent("curl/7.54.0")
remoteLinks, response, err := instance.Issue.Link.Remote.Gets(context.Background(), "KP-23", "")
if err != nil {
if response != nil {
log.Println(response.Bytes.String())
}
log.Fatal(err)
}
for _, remoteLink := range remoteLinks {
fmt.Println(remoteLink.ID)
}
}
Create remote issue link
POST /rest/api/{2-3}/issue/{issueIdOrKey}/remotelink
Create creates or updates a remote issue link for an issue.
If a globalId is provided and a remote issue link with that global ID is found it is updated. Any fields without values in the request are set to null. Otherwise, the remote issue link is created.
DeleteByGlobalId deletes the remote issue link from the issue using the link's global ID where the global ID includes reserved URL characters these must be escaped in the request.