@@ -547,6 +547,44 @@ type AddWorklogQueryOptions struct {
547
547
// This can heavily differ between JIRA instances
548
548
type CustomFields map [string ]string
549
549
550
+ // RemoteLink represents remote links which linked to issues
551
+ type RemoteLink struct {
552
+ ID int `json:"id,omitempty" structs:"id,omitempty"`
553
+ Self string `json:"self,omitempty" structs:"self,omitempty"`
554
+ GlobalID string `json:"globalId,omitempty" structs:"globalId,omitempty"`
555
+ Application * RemoteLinkApplication `json:"application,omitempty" structs:"application,omitempty"`
556
+ Relationship string `json:"relationship,omitempty" structs:"relationship,omitempty"`
557
+ Object * RemoteLinkObject `json:"object,omitempty" structs:"object,omitempty"`
558
+ }
559
+
560
+ // RemoteLinkApplication represents remote links application
561
+ type RemoteLinkApplication struct {
562
+ Type string `json:"type,omitempty" structs:"type,omitempty"`
563
+ Name string `json:"name,omitempty" structs:"name,omitempty"`
564
+ }
565
+
566
+ // RemoteLinkObject represents remote link object itself
567
+ type RemoteLinkObject struct {
568
+ URL string `json:"url,omitempty" structs:"url,omitempty"`
569
+ Title string `json:"title,omitempty" structs:"title,omitempty"`
570
+ Summary string `json:"summary,omitempty" structs:"summary,omitempty"`
571
+ Icon * RemoteLinkIcon `json:"icon,omitempty" structs:"icon,omitempty"`
572
+ Status * RemoteLinkStatus `json:"status,omitempty" structs:"status,omitempty"`
573
+ }
574
+
575
+ // RemoteLinkIcon represents icon displayed next to link
576
+ type RemoteLinkIcon struct {
577
+ Url16x16 string `json:"url16x16,omitempty" structs:"url16x16,omitempty"`
578
+ Title string `json:"title,omitempty" structs:"title,omitempty"`
579
+ Link string `json:"link,omitempty" structs:"link,omitempty"`
580
+ }
581
+
582
+ // RemoteLinkStatus if the link is a resolvable object (issue, epic) - the structure represent its status
583
+ type RemoteLinkStatus struct {
584
+ Resolved bool
585
+ Icon * RemoteLinkIcon
586
+ }
587
+
550
588
// Get returns a full representation of the issue for the given issue key.
551
589
// JIRA will attempt to identify the issue by the issueIdOrKey path parameter.
552
590
// This can be an issue id, or an issue key.
@@ -1274,3 +1312,21 @@ func (c ChangelogHistory) CreatedTime() (time.Time, error) {
1274
1312
t , err := time .Parse ("2006-01-02T15:04:05.999-0700" , c .Created )
1275
1313
return t , err
1276
1314
}
1315
+
1316
+ // GetRemoteLinks gets remote issue links on the issue.
1317
+ //
1318
+ // JIRA API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issue-getRemoteIssueLinks
1319
+ func (s * IssueService ) GetRemoteLinks (id string ) (* []RemoteLink , * Response , error ) {
1320
+ apiEndpoint := fmt .Sprintf ("rest/api/2/issue/%s/remotelink" , id )
1321
+ req , err := s .client .NewRequest ("GET" , apiEndpoint , nil )
1322
+ if err != nil {
1323
+ return nil , nil , err
1324
+ }
1325
+
1326
+ result := new ([]RemoteLink )
1327
+ resp , err := s .client .Do (req , result )
1328
+ if err != nil {
1329
+ err = NewJiraError (resp , err )
1330
+ }
1331
+ return result , resp , err
1332
+ }
0 commit comments