I’m using jira-client to create a jira utility
I split my functions into two files but when I try to execute now I get
TypeError: Cannot read properties of undefined
This is the code
changeStatus: function (issueId, transitionId) {
return new Promise((resolve, rejects) => {
if (isString(issueId) && issueId.length === 7 && isString(transitionId)) {
jira
.transitionIssue(issueId, {
transition: {
id: transitionId,
},
})
.then((transition) => {
resolve(transition);
})
.catch((error) => {
rejects(error);
});
} else {
rejects(`The request cannot be handled as a result of \n
The issueId ${issueId} is not valid due to \n
1. The value passed is not a String \n
2. The value passed is not of length 7 \n
or \n
The transitionId ${transitionId} provided is not string`);
}
});
},
checkStatus: function (issueId) {
jiraApis
.checkIssueStatus(issueId)
.then((issue) => {
console.log(`Status of the issue is ${issue}`);
})
.catch((err) => {
console.error(err);
});
},
jiraApis.checkStatus("<issueId redacted>")
this call results in TypeError: Cannot read properties of undefined (reading 'findIssue')
Any idea why ?