Hi Team,
I am calling addon.httpclient to call rest API of JIRA, please check the below code
but here it’s not updating data value after printing on console its showing undefined.
did I am missing something here?
async function getAllProjects(req, ts)
{
let data;
return new Promise((resolve, reject) => {
plugin.httpClient(req)
/.asUserByAccountId(userAccountId)/
.get(“rest/api/3/project?”, function(err, response, body)
{
data = JSON.parse(body);
if (err) reject(err);
resolve(data);
});
console.log(data+">>>>>>>>>>>>>>>>>>>>>>>>>>>"+JSON.stringify(data));
return data;
});
Any Help on this, please.
Thanks in advance.