@atlassian/jira
v0.1.0
Published
Jira API client for Browser and Node.js
Downloads
3,540
Readme
Jira.js
JIRA API client for Browser and Node.js
This is a port of the excellent bitbucket library by Munif Tanjim: https://github.com/MunifTanjim/node-bitbucket
JIRA API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/
Installation
via npm:
$ npm install @atlassian/jira --save
via yarn:
$ yarn add @atlassian/jira
Usage
Node
const JIRA = require('@atlassian/jira')
const jira = new JIRA()
Client Options
You can set the APIs' baseUrl
and modify some behaviors (e.g. request timeout etc.) by passing a clientOptions object to the JIRA
constructor.
const clientOptions = {
baseUrl: 'https://api.atlassian.com/ex/jira/${cloudId}/rest/',
headers: {},
options: {
timeout: 10
}
}
const jira = new JIRA(clientOptions)
This enables you to use jira
with Jira Cloud.
Authentication
Basic
jira.authenticate({
type: 'basic',
username: 'username',
password: 'password'
})
OAuth
jira.authenticate({
type: 'token',
token: 'access token'
})