Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration Errors from jira.js 2.19.1 to 3.0.5 #311

Closed
MrRefactoring opened this issue May 1, 2024 · 0 comments
Closed

Migration Errors from jira.js 2.19.1 to 3.0.5 #311

MrRefactoring opened this issue May 1, 2024 · 0 comments
Labels
question Raised for inquiries, clarifications, or discussions related to the project. wontfix Indicates that, while acknowledged, the particular issue or request won't be acted upon.

Comments

@MrRefactoring
Copy link
Owner

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!

@MrRefactoring MrRefactoring added bug Indicates a reported issue or malfunction that needs fixing. Investigation required Points out issues that need further exploration or detailed examination. question Raised for inquiries, clarifications, or discussions related to the project. wontfix Indicates that, while acknowledged, the particular issue or request won't be acted upon. and removed bug Indicates a reported issue or malfunction that needs fixing. Investigation required Points out issues that need further exploration or detailed examination. labels May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Raised for inquiries, clarifications, or discussions related to the project. wontfix Indicates that, while acknowledged, the particular issue or request won't be acted upon.
Projects
None yet
Development

No branches or pull requests

1 participant