|
112 | 112 | // * _0.0.3 Added APIs and Docco documentation_
|
113 | 113 | // * _0.0.2 Initial version_
|
114 | 114 | var url = require('url'),
|
115 |
| - FormData = require('form-data'), |
116 |
| - fs = require('fs'), |
117 | 115 | logger = console;
|
118 | 116 |
|
119 | 117 |
|
@@ -869,23 +867,14 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
|
869 | 867 | });
|
870 | 868 | };
|
871 | 869 |
|
872 |
| -<<<<<<< HEAD |
873 | 870 | // ## List Components ##
|
874 | 871 | // ### Takes ###
|
875 | 872 | //
|
876 | 873 | // * project: key for the project
|
877 |
| -======= |
878 |
| - // ## Assign issue in Jira ## |
879 |
| - // ### Takes ### |
880 |
| - // |
881 |
| - // * issueId: the Id of the issue to delete |
882 |
| - // * issueUpdate: username of the assignee |
883 |
| ->>>>>>> bbae5ff8ea8893449ee2d00000eb91dde4860dfc |
884 | 874 | // * callback: for when it's done
|
885 | 875 | //
|
886 | 876 | // ### Returns ###
|
887 | 877 | // * error string
|
888 |
| -<<<<<<< HEAD |
889 | 878 | // * array of components
|
890 | 879 | //
|
891 | 880 | // [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id290489)
|
@@ -921,28 +910,12 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
|
921 | 910 | };
|
922 | 911 |
|
923 | 912 | this.request(options, function(error, response, body) {
|
924 |
| -======= |
925 |
| - // * success string |
926 |
| - // |
927 |
| - // [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#idp1342720) |
928 |
| - this.assign = function(issueNum, assignee, callback) { |
929 |
| - var options = { |
930 |
| - rejectUnauthorized: this.strictSSL, |
931 |
| - uri: this.makeUri('/issue/' + issueNum + '/assignee'), |
932 |
| - json: {name: assignee}, |
933 |
| - method: 'PUT', |
934 |
| - followAllRedirects: true |
935 |
| - }; |
936 |
| - |
937 |
| - this.request(options, function(error, response) { |
938 |
| ->>>>>>> bbae5ff8ea8893449ee2d00000eb91dde4860dfc |
939 | 913 |
|
940 | 914 | if (error) {
|
941 | 915 | callback(error, null);
|
942 | 916 | return;
|
943 | 917 | }
|
944 | 918 |
|
945 |
| -<<<<<<< HEAD |
946 | 919 | if (response.statusCode === 200) {
|
947 | 920 | callback(null, body);
|
948 | 921 | return;
|
@@ -1054,14 +1027,6 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
|
1054 | 1027 | }
|
1055 | 1028 |
|
1056 | 1029 | callback(response.statusCode + ': Error while updating');
|
1057 |
| -======= |
1058 |
| - if (response.statusCode === 204) { |
1059 |
| - callback(null, "Success"); |
1060 |
| - return; |
1061 |
| - } |
1062 |
| - |
1063 |
| - callback(response.statusCode + ': Error while assigning'); |
1064 |
| ->>>>>>> bbae5ff8ea8893449ee2d00000eb91dde4860dfc |
1065 | 1030 |
|
1066 | 1031 | });
|
1067 | 1032 | };
|
@@ -1181,61 +1146,6 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
|
1181 | 1146 | });
|
1182 | 1147 | };
|
1183 | 1148 |
|
1184 |
| -<<<<<<< HEAD |
1185 |
| -======= |
1186 |
| - // ## Add attachment to issue ## |
1187 |
| - // ### Takes ### |
1188 |
| - // |
1189 |
| - // * issueId: the Id of the issue to delete |
1190 |
| - // * path: local path to the attachment |
1191 |
| - // * callback: for when it's done |
1192 |
| - // |
1193 |
| - // ### Returns ### |
1194 |
| - // * error string |
1195 |
| - // * success string |
1196 |
| - // |
1197 |
| - // [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#idp2051136) |
1198 |
| - this.attachToIssue = function(issueNum, path, callback) { |
1199 |
| - var self = this; |
1200 |
| - var options = { |
1201 |
| - rejectUnauthorized: this.strictSSL, |
1202 |
| - uri: this.makeUri('/issue/' + issueNum + '/attachments'), |
1203 |
| - method: 'POST', |
1204 |
| - followAllRedirects: true, |
1205 |
| - json: true, |
1206 |
| - headers: { |
1207 |
| - 'x-atlassian-token': 'nocheck' |
1208 |
| - } |
1209 |
| - }; |
1210 |
| - |
1211 |
| - var form = new FormData(); |
1212 |
| - form.append('file', fs.createReadStream(path)); |
1213 |
| - |
1214 |
| - form.getLength(function(err, length) { |
1215 |
| - |
1216 |
| - var form_request = self.request(options, function(error, response) { |
1217 |
| - if (error) { |
1218 |
| - callback(error, null); |
1219 |
| - return; |
1220 |
| - } |
1221 |
| - |
1222 |
| - if (response.statusCode === 200) { |
1223 |
| - callback(null, "Success"); |
1224 |
| - return; |
1225 |
| - } |
1226 |
| - |
1227 |
| - callback(response.statusCode + ': Error while uploading'); |
1228 |
| - |
1229 |
| - }); |
1230 |
| - |
1231 |
| - form_request.setHeader('Content-Length', length); |
1232 |
| - form = form_request.form(); |
1233 |
| - form.append('file', fs.createReadStream(path)); |
1234 |
| - }); |
1235 |
| - |
1236 |
| - }; |
1237 |
| - |
1238 |
| ->>>>>>> bbae5ff8ea8893449ee2d00000eb91dde4860dfc |
1239 | 1149 | // ## List all Viewable Projects ##
|
1240 | 1150 | // ### Takes ###
|
1241 | 1151 | //
|
|
0 commit comments