From 0cd8479f6bc939ef409b990194733fc0f829de92 Mon Sep 17 00:00:00 2001 From: Bill Sykes Date: Thu, 22 Sep 2016 22:32:14 -0400 Subject: [PATCH] Add support for querying dev status --- lib/jira.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/lib/jira.js b/lib/jira.js index 190e2661..4590c5b7 100644 --- a/lib/jira.js +++ b/lib/jira.js @@ -2139,4 +2139,41 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor }); }; + // ## Get dev status ## + // ### Takes ### + // + // * issueId: issue to to query status + // * applicationType: type of application + // * dataType: type of data to query + // * callback: for when it's done + // + // ### Returns ### + // * error string + // * success object + // + this.getDevStatusDetail = function(issueId, applicationType, dataType, callback) { + var options = { + rejectUnauthorized: this.strictSSL, + uri: this.makeUri('/issue/detail?issueId=' + issueId + '&applicationType=' + applicationType + '&dataType=' + dataType, 'rest/dev-status/', '1.0'), + method: 'GET', + json: true + }; + + this.doRequest(options, function(error, response, body) { + + if (error) { + callback(error, null); + return; + } + + if (response.statusCode === 200) { + callback(null, body); + return; + } + + callback(response.statusCode + ': Error while getting dev status'); + + }); + }; + }).call(JiraApi.prototype);