node-jira
node-jira copied to clipboard
get all sprints for a rapidId ... maybe a patch
after some fidleing and reading the docs I came up with this function I needed for some reason
JiraApi.prototype.getAllSprintsForRapidId = function (rapidViewId, callback) {
var options = {
rejectUnauthorized: this.strictSSL,
uri: this.makeUri('/sprintquery/' + rapidViewId, 'rest/greenhopper/'),
method: 'GET',
json: true
};
this.request(options, function (error, response) {
if (error) {
callback(error, null);
return;
}
if (response.statusCode === 404) {
callback('Invalid URL');
return;
}
if (response.statusCode !== 200) {
callback(response.statusCode + ': Unable to connect to JIRA during sprints search.');
return;
}
if (response.body !== null) {
var sprints = response.body;
callback(null, sprints);
return;
}
});
}