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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

NodeJS - JIRA Cloud API REST Authentification ECONNREFUSED 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

Hi @AMIENS CGI

 

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

 

Thanks

Same problem here. Was anyone able to solve this?

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you