Closed
Description
Hi,
Is there a guide on how to migrate from jira.js version 2.19.1 to 3.0.5? After updating the version and running my project, I encounter several errors related to bad requests and incorrect project specifications. Here are some of the errors I'm seeing:
- Error indicating that the project must be specified to create a version.
- Error stating that the version name is not valid.
- Error updating issue with a 404 not found due to a null URI.
Below is an example of how I'm currently using jira.js:
const client2 = new Version2Client({
host: process.env.RM_JIRA_URI,
newErrorHandling: true,
telemetry: false,
rejectUnauthorized: false,
authentication: {
basic: {
username: process.env.RM_JIRA_USERNAME,
password: process.env.RM_JIRA_PASSWORD
}
}
})
async function isVersionInProjectNew(fixVersion, projectToCheck) {
const project = { projectIdOrKey: projectToCheck }
const versions = await client2.projectVersions
.getProjectVersions(project)
.then(res => {
if (res.errorMessages && res.errorMessages.length >= 0) {
throw res
}
return res
})
.catch(error => {
logger.error('failed to load isVersionInProject', error)
return []
})
let versionsForFixVersion = []
if (versions) {
versionsForFixVersion = versions.filter(v => v.name === fixVersion).map(v => {
logger.info('Fixversion ' + fixVersion + ' exists in project: ' + projectToCheck + ' - ' + v.description + '.')
return v
})
}
return versionsForFixVersion.length > 0
}
Could anyone provide insights or documentation on proper migration steps?
Thanks!