The goal of jira-facade is to be a simple facade to the jira wrapper module that simplifies some of the more tedious processes such as getting IDs for versions, priorities, components, etc.
NOTE: Better documentation is coming.
npm install -S jira-facade
var JiraFacade = require('jira-facade');
This is basically a pass through to the jira
var jiraFacade = new JiraFacade({
protocol: 'https',
host: 'jira.example.com',
port: 443,
username: 'splunk-user',
password: 'splunk-password',
apiVersion: '2',
})
This is an instance of the jira module and has full access to all of its methods. See the jira module page for detailed documentation.
jiraFacade.jira.getProject('EXAMPLEKEY', function(err, project){
console.log(project);
});
Creates a JIRA issue and returns the issue object from the JIRA api.
jiraFacade.createIssue({
project: 'EXAMPLEKEY',
issueType: 'Task',
summary: 'Issue Summary/Subject',
description: 'Issue Description',
fixVersions: ['Backlog'],
components: ['Services', 'Site'],
assignee: 'joe.developer',
reporter: 'sally.manager',
priority: 'Critical',
labels: ['services', 'website']
}, function(err, issue){
console.log(issue.id);
});
Options
project
(string) JIRA Project KeyissueType
(string) The issueType name (e.g. Bug)summary
(string) The summary or subject of the issue to be createddescription
(string) The issue descriptionfixVersions
(Array) Array of version names this issue will be incomponents
(Array) Array of Component names this isssue is associated withassignee
(string) JIRA username of the assigneereporter
(string) JIRA username of hte reporterpriority
(string) Severity name (e.g. Critical)labels
(Array) Array of string labels to apply to the issue
Adds the user username
to the issue issueKey
jiraFacade.addUser('MYPROJ-548', 'kmorris', function(err){
console.log("Error:", err);
});
Returns a JIRA version
object from a specific project based on the name of that version.
jiraFacade.getVersionByName('EXAMPLEKEY', '1.0.0', function(err, version){
console.log(version);
});
Returns a JIRA global priority
object based on the name of that priority.
jiraFacade.getPriorityByName('Critical', function(err, priority){
console.log(priority);
});
Returns a JIRA global priority
object based on the id of that priority.
jiraFacade.getPriorityById(2, function(err, priority){
console.log(priority);
});
Returns a JIRA global issueType
object based on the name of that issueType.
jiraFacade.getIssueTypeByName('Bug', function(err, issueType){
console.log(priority);
});