1.3.1 • Published 4 months ago
oa-jira v1.3.1
Octet Agile's JIRA connectivity project.
The purpose of this project is to provide a set of connectivity utilities to Jira APIs.
Issues
Get Issue By Key
This service need two / three arguments.
const oaJira = require('oa-jira');
return Promise.all([
oaJira.connection.createBasic({baseUrl: '...', user: '...', token: '...'}),
oaJira.cache.init()
])
.then(([connection, cache]) => oaJira.issues.getByKey({ connection, key: 'ISSUE-111', cache }))
.then(issue => {
console.log(JSON.stringify(issue));
return Promise.resolve();
})
.catch(error => {
console.log(error);
return Promise.resolve();
});
Argument | Type | Description |
---|---|---|
connection | Object | The credential use by the library to call jira issue get rest API (2.0). |
key | string | The issue key, as jira provide it to you. |
cache | Object | Optionnal |
The connection argument is an instance of Connection class. This one is mandatory.
Use oaJira.connection.createBasic
method or oaJira.connection.createBearer
to initialize a new instance.
const connection = await oaJira.connection.createBasic({
baseUrl: '...url base of your jira...',
user: "...your user's login...",
token: "...your jira's token..."
});
The issue key argument is a string
equals to your jira issue key, this one is mandatory.
The cache argument is optionnal object
.
Use oaJira.cache.init
method to initialize a new cache.