Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

get all sprints for a rapidId ... maybe a patch #47

Open
sebs opened this Issue · 0 comments

1 participant

Sebastian Schürmann
Sebastian Schürmann

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;
    }

  });

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.