mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
31 lines
599 B
TypeScript
31 lines
599 B
TypeScript
import JiraApi from 'jira-client';
|
|
|
|
// Initialize
|
|
const jira = new JiraApi({
|
|
protocol: 'https',
|
|
host: 'jira.somehost.com',
|
|
username: 'username',
|
|
password: 'password',
|
|
apiVersion: '2',
|
|
strictSSL: true
|
|
});
|
|
|
|
const issueNumber = "123";
|
|
|
|
jira.findIssue(issueNumber)
|
|
.then(issue => {
|
|
console.log(`Status: ${issue.fields.status.name}`);
|
|
})
|
|
.catch(err => {
|
|
console.error(err);
|
|
});
|
|
|
|
async function logIssueName() {
|
|
try {
|
|
const issue = await jira.findIssue(issueNumber);
|
|
console.log(`Status: ${issue.fields.status.name}`);
|
|
} catch (err) {
|
|
console.error(err);
|
|
}
|
|
}
|