How do i access jira API via node.js?

William Yip November 30, 2017

Can anyone please help me?? 

At the moment i am using the following node.js modules to access the Jira Api

https://github.com/jira-node/node-jira-client

 

My Code-----------------------------------------------

 

var JiraApi = require('jira-client');

// Initializevar jira = new JiraApi({

protocol: 'https',

host: 'wooldigital.atlassian.net',

username: 'xxxxxxxxxxxxxx',

password: 'xxxxxxxxxxxxxxxx',

apiVersion: '2',

strictSSL: true});

// ES5// We are using an ES5 Polyfill for Promise support. Please note that if you don't explicitly// apply a catch exceptions will get swallowed. Read up on ES6 Promises for further details.

jira.findIssue(issueNumber).then(function(issue) {

console.log('Status: ' + issue.fields.status.name);})

.catch(function(err) { console.error(err);});

 

----------------------

I am sure it is the right details, but i keep getting the following error :

jira.findIssue(issueNumber)
^

ReferenceError: issueNumber is not defined
at Object.<anonymous> (C:\xxxxxx\xxxxxx\xxxxxxxx\node_modules\index.j
s:20:16)

 

Is it not suppose to get the issue number automatically from the api ? Anyone help please

2 answers

0 votes
07 May 19, 2019

try to enter specific issue number

0 votes
Randy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2018

start by uncommenting this line:

// Initializevar jira = new JiraApi({

Suggest an answer

Log in or Sign up to answer