项目作者: jira-node

项目描述 :
用于JIRA REST API的nodejs包装器
高级语言: JavaScript
项目地址: git://github.com/jira-node/node-jira-client.git
创建时间: 2015-12-03T15:02:21Z
项目社区:https://github.com/jira-node/node-jira-client

开源协议:MIT License

下载


JavaScript JIRA API for node.js

A node.js module, which provides an object oriented wrapper for the Jira Rest API.

Documentation
Jira Rest API
Run tests
npm
Downloads
Install Size
dependency Status
devDependency Status

Installation

Install with the node package manager npm:

  1. $ npm install jira-client

Examples

Create the JIRA client

  1. // With ES5
  2. var JiraApi = require('jira-client');
  3. // With ES6
  4. import JiraApi from 'jira-client';
  5. // Initialize
  6. var jira = new JiraApi({
  7. protocol: 'https',
  8. host: 'jira.somehost.com',
  9. username: 'username',
  10. password: 'password',
  11. apiVersion: '2',
  12. strictSSL: true
  13. });

Find the status of an issue

  1. // ES5
  2. // We are using an ES5 Polyfill for Promise support. Please note that if you don't explicitly
  3. // apply a catch exceptions will get swallowed. Read up on ES6 Promises for further details.
  4. jira.findIssue(issueNumber)
  5. .then(function(issue) {
  6. console.log('Status: ' + issue.fields.status.name);
  7. })
  8. .catch(function(err) {
  9. console.error(err);
  10. });
  11. // ES6
  12. jira.findIssue(issueNumber)
  13. .then(issue => {
  14. console.log(`Status: ${issue.fields.status.name}`);
  15. })
  16. .catch(err => {
  17. console.error(err);
  18. });
  19. // ES7
  20. async function logIssueName() {
  21. try {
  22. const issue = await jira.findIssue(issueNumber);
  23. console.log(`Status: ${issue.fields.status.name}`);
  24. } catch (err) {
  25. console.error(err);
  26. }
  27. }

Documentation

Can’t find what you need in the readme? Check out our documentation here: https://jira-node.github.io/