Skip to content

Commit 99eee6a

Browse files
Fix #28
1 parent 9acfdd5 commit 99eee6a

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

lib/jira.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,59 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
919919
});
920920
};
921921

922+
// ## List listFields ##
923+
// ### Takes ###
924+
//
925+
// * callback: for when it's done
926+
//
927+
// ### Returns ###
928+
// * error string
929+
// * array of priorities
930+
//
931+
// [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id290489)
932+
/*
933+
* [{
934+
* "id": "field",
935+
* "name": "Field",
936+
* "custom": false,
937+
* "orderable": true,
938+
* "navigable": true,
939+
* "searchable": true,
940+
* "schema": {
941+
* "type": "string",
942+
* "system": "field"
943+
* }
944+
* }]
945+
*/
946+
this.listFields = function(callback) {
947+
var options = {
948+
rejectUnauthorized: this.strictSSL,
949+
uri: this.makeUri('/field'),
950+
method: 'GET',
951+
json: true
952+
};
953+
954+
this.request(options, function(error, response, body) {
955+
956+
if (error) {
957+
callback(error, null);
958+
return;
959+
}
960+
961+
if (response.statusCode === 200) {
962+
callback(null, body);
963+
return;
964+
}
965+
if (response.statusCode === 404) {
966+
callback("Not found");
967+
return;
968+
}
969+
970+
callback(response.statusCode + ': Error while updating');
971+
972+
});
973+
};
974+
922975
// ## List listPriorities ##
923976
// ### Takes ###
924977
//

0 commit comments

Comments
 (0)