synergia-jira-connector
Version:
Easy to use NodeJS wrapper for the Jira REST API.
52 lines (46 loc) • 1.4 kB
JavaScript
module.exports = PriorityClient;
/**
* Used to access Jira REST endpoints in '/rest/api/2/priority'
*
* @param {JiraClient} jiraClient
* @constructor PriorityClient
*/
function PriorityClient (jiraClient) {
this.jiraClient = jiraClient;
/**
* Returns a list of all priorities visible to the user
*
* @method getAllPriorities
* @memberOf PriorityClient#
* @param opts Ignored
* @param callback Called when the priorities have been retrieved.
*/
this.getAllPriorities = function (opts, callback) {
var options = {
uri: this.jiraClient.buildURL('/priority'),
method: 'GET',
json: true,
followAllRedirects: true
};
this.jiraClient.makeRequest(options, callback);
};
/**
* Get a full representation of the priority that has the given id.
*
* @method getPriority
* @memberOf PriorityClient#
* @param opts The options sent to the Jira API
* @param opts.priorityId A String containing a priority id
* @param callback Called when the priority has been retrieved.
*/
this.getPriority = function (opts, callback) {
var options = {
uri: this.jiraClient.buildURL('/priority/' + opts.priorityId),
method: 'GET',
json: true,
followAllRedirects: true
};
this.jiraClient.makeRequest(options, callback);
};
}
;