oa-jira
Version:
Octet Agile's JIRA connectivity project.
52 lines (39 loc) • 1.81 kB
Markdown
The purpose of this project is to provide a **set of connectivity utilities to Jira APIs**.
---
This service need two / three arguments.
```javascript
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.
```javascript
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.