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 :
Thank you for your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.