File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,6 +151,25 @@ define(function (require, exports) {
151151 } ) ;
152152 } ;
153153
154+ self . addComment = function ( args ) {
155+ var repoApiUrl = args . server . api + args . issueTracker . context ,
156+ requestUrl = repoApiUrl + "/issues/" + args . number + "/comments" ,
157+ credential = args . server . credential . usr + ":" + args . server . credential . pass ;
158+
159+ return $ . ajax
160+ ( {
161+ type : "POST" ,
162+ url : requestUrl ,
163+ data : { content :args . text } ,
164+ async : true ,
165+ beforeSend : function ( xhr ) {
166+ xhr . setRequestHeader ( 'Authorization' , "Basic " + btoa ( credential ) ) ;
167+ }
168+ } ) . done ( function ( response ) {
169+ console . log ( "Comment created sucessfully" ) ;
170+ console . log ( response ) ;
171+ } ) ;
172+ } ;
154173 exports . name = "Bitbucket" ;
155174 exports . getIssues = self . getIssues ;
156175 exports . issueDetail = self . issueDetail ;
Original file line number Diff line number Diff line change @@ -161,11 +161,8 @@ define(function (require, exports) {
161161 console . warn ( "[Gitlab connector] The user doesn't have any acces token!" ) ;
162162 }
163163
164- var tengoladata = {
165- body : args . text
166- } ;
167- return $ . ajax
168- ( {
164+ return $ . ajax
165+ ( {
169166 type : "POST" ,
170167 url : requestUrl ,
171168 data : { body :args . text } ,
You can’t perform that action at this time.
0 commit comments