Skip to content

Migration Errors from jira.js 2.19.1 to 3.0.5 #311

Closed
@MrRefactoring

Description

@MrRefactoring

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionRaised for inquiries, clarifications, or discussions related to the project.wontfixIndicates that, while acknowledged, the particular issue or request won't be acted upon.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions