Skip to content

Facade to the jira wrapper module that simplifies some of the more tedious processes.

License

Notifications You must be signed in to change notification settings

MoxieUSA/node-jira-facade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jira-facade

Build Status

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.

Installation

npm install -S jira-facade

var JiraFacade = require('jira-facade');

Methods

new JiraFacade(options) (Constructor)

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',
})

jira

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

createIssue(options, callback)

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 Key
  • issueType (string) The issueType name (e.g. Bug)
  • summary (string) The summary or subject of the issue to be created
  • description (string) The issue description
  • fixVersions (Array) Array of version names this issue will be in
  • components (Array) Array of Component names this isssue is associated with
  • assignee (string) JIRA username of the assignee
  • reporter (string) JIRA username of hte reporter
  • priority (string) Severity name (e.g. Critical)
  • labels (Array) Array of string labels to apply to the issue

addWatcher(issueKey, username, callback)

Adds the user username to the issue issueKey

jiraFacade.addUser('MYPROJ-548', 'kmorris', function(err){
	console.log("Error:", err);
});

getVersionByName(project, versionName, callback)

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

getPriorityByName(priorityName, callback)

Returns a JIRA global priority object based on the name of that priority.

jiraFacade.getPriorityByName('Critical', function(err, priority){
	console.log(priority);
});

getPriorityById(priorityId, callback)

Returns a JIRA global priority object based on the id of that priority.

jiraFacade.getPriorityById(2, function(err, priority){
	console.log(priority);
});

getIssueTypeByName(priorityName, callback)

Returns a JIRA global issueType object based on the name of that issueType.

jiraFacade.getIssueTypeByName('Bug', function(err, issueType){
	console.log(priority);
});

About

Facade to the jira wrapper module that simplifies some of the more tedious processes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published