Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×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.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register Now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.