Skip to content

Commit 9acfdd5

Browse files
Fix #26
1 parent c1db1bd commit 9acfdd5

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

lib/jira.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,55 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
918918

919919
});
920920
};
921+
922+
// ## List listPriorities ##
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+
* "self": "http://localhostname:8090/jira/rest/api/2.0/priority/1",
935+
* "statusColor": "#ff3300",
936+
* "description": "Crashes, loss of data, severe memory leak.",
937+
* "name": "Major",
938+
* "id": "2"
939+
* }]
940+
*/
941+
this.listPriorities = function(callback) {
942+
var options = {
943+
rejectUnauthorized: this.strictSSL,
944+
uri: this.makeUri('/priority'),
945+
method: 'GET',
946+
json: true
947+
};
948+
949+
this.request(options, function(error, response, body) {
950+
951+
if (error) {
952+
callback(error, null);
953+
return;
954+
}
955+
956+
if (response.statusCode === 200) {
957+
callback(null, body);
958+
return;
959+
}
960+
if (response.statusCode === 404) {
961+
callback("Not found");
962+
return;
963+
}
964+
965+
callback(response.statusCode + ': Error while updating');
966+
967+
});
968+
};
969+
921970
// ## List Transitions ##
922971
// ### Takes ###
923972
//

0 commit comments

Comments
 (0)