NodeJS - JIRA Cloud API REST Authentification ECONNREFUSED

AMIENS CGI May 16, 2019

Hi,

I try to connect with NodeJS to the JIRA Cloud API but I constantly receive feedback messages saying ECONNREFUSED

But it works in the browser !

I tried with the password and API Token, but they all return the same result

var cron = require('node-cron');
var https = require('https');
var jira = {
editis
: {
host
: "jiraeditis.atlassian.net",
auth
: "email:password",
rejectUnauthorized
: false,
headers
: {
//'Content-Type': 'application/json',
//'Authorization': 'Basic ' + Buffer.from("email:token").toString('base64')
}

}
}

cron.schedule('*/5 * * * * *', () => { getIssue(0)});

var
getIssue = function (start) {

/** * Récupération des imputations par projet. */
var options = Object.assign({}, jira.editis); options.path = "/rest/api/2/search?startAt={startAt}&maxResults=-1&jql=level={level}" .replace('{startAt}', start).replace('{level}', "10002");

https
.request(options, (resp) => { var body = '';
resp.on('data', (chunk) => { body += chunk; });
resp.on('end', () => {
if (JSON.parse(body).length == 0 || JSON.parse(body).total == 0) { res.json(jsonResult); return; }
JSON.parse(body).issues.forEach(function (e) { console.log(e.id) });
});
}).
on("error", (e) => { console.log("Error: " + e.message); }).end();
}

 and I have as a result :

Error: connect ECONNREFUSED 52.215.192.145:443
Error: connect ECONNREFUSED 52.215.192.145:443
Error: connect ECONNREFUSED 52.215.192.145:443
Error: connect ECONNREFUSED 52.215.192.145:443
Error: connect ECONNREFUSED 52.215.192.145:443
Error: connect ECONNREFUSED 52.215.192.145:443
Error: connect ECONNREFUSED 52.215.192.145:443

And the IP get :

Capture.PNG

Thank you for your help

1 answer

0 votes
fabio August 7, 2019

Hi @AMIENS CGI

 

I am also having this issue. Were you able to solve it?

 

Thanks

webks GmbH July 14, 2021

Same problem here. Was anyone able to solve this?

Suggest an answer

Log in or Sign up to answer