@@ -1755,3 +1755,47 @@ func TestIssueService_GetRemoteLinks(t *testing.T) {
1755
1755
t .Errorf ("First remote link object status should be resolved" )
1756
1756
}
1757
1757
}
1758
+
1759
+ func TestIssueService_AddRemoteLink (t * testing.T ) {
1760
+ setup ()
1761
+ defer teardown ()
1762
+ testMux .HandleFunc ("/rest/api/2/issue/10000/remotelink" , func (w http.ResponseWriter , r * http.Request ) {
1763
+ testMethod (t , r , "POST" )
1764
+ testRequestURL (t , r , "/rest/api/2/issue/10000/remotelink" )
1765
+
1766
+ w .WriteHeader (http .StatusCreated )
1767
+ fmt .Fprint (w , `{"id": 10000, "self": "https://your-domain.atlassian.net/rest/api/issue/MKY-1/remotelink/10000"}` )
1768
+ })
1769
+ r := & RemoteLink {
1770
+ Application : & RemoteLinkApplication {
1771
+ Name : "My Acme Tracker" ,
1772
+ Type : "com.acme.tracker" ,
1773
+ },
1774
+ GlobalID : "system=http://www.mycompany.com/support&id=1" ,
1775
+ Relationship : "causes" ,
1776
+ Object : & RemoteLinkObject {
1777
+ Summary : "Customer support issue" ,
1778
+ Icon : & RemoteLinkIcon {
1779
+ Url16x16 : "http://www.mycompany.com/support/ticket.png" ,
1780
+ Title : "Support Ticket" ,
1781
+ },
1782
+ Title : "TSTSUP-111" ,
1783
+ URL : "http://www.mycompany.com/support?id=1" ,
1784
+ Status : & RemoteLinkStatus {
1785
+ Icon : & RemoteLinkIcon {
1786
+ Url16x16 : "http://www.mycompany.com/support/resolved.png" ,
1787
+ Title : "Case Closed" ,
1788
+ Link : "http://www.mycompany.com/support?id=1&details=closed" ,
1789
+ },
1790
+ Resolved : true ,
1791
+ },
1792
+ },
1793
+ }
1794
+ record , _ , err := testClient .Issue .AddRemoteLink ("10000" , r )
1795
+ if record == nil {
1796
+ t .Error ("Expected Record. Record is nil" )
1797
+ }
1798
+ if err != nil {
1799
+ t .Errorf ("Error given: %s" , err )
1800
+ }
1801
+ }
0 commit comments