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.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

NodeJS - JIRA Cloud API REST Authentification ECONNREFUSED

AMIENS CGI
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!
May 16, 2019 edited

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
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!
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
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

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
AUG Leaders

Upcoming Jira Events