Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot connect to JIRA with NodeJS (jira-client)

Siripong_C
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 5, 2020

This is my Node JS code:

 

const jiraApi = require('jira-client');

var jira = new jiraApi({protocol: 'https',
host: 'jira.XXXX.global',
username: 'myUsername',
password: 'myPassword',
apiVersion: '2'});

jira.findIssue('myIssueNumber').then(() => {
console.log(`Status: ${issue.fields.status.name}`
)}).catch((error=> {
console.log(error)});

 

I expect to see issue.fields.status.name in my terminal but I encounter Request failed with status code 401.

I am sure my username and password are correct because I can access JIRA application via chrome and I can see the detail of this IssueNumber.

I don't know why I encounter 401 error. Can anyone help me?

0 answers

Suggest an answer

Log in or Sign up to answer