MrRefactoring / jira.js

A JavaScript/TypeScript wrapper for the JIRA Cloud, Service Desk and Agile REST API
https://mrrefactoring.github.io/jira.js/
MIT License
349 stars 46 forks source link

Client V2 -> V3 #259

Closed shadowempire123 closed 9 months ago

shadowempire123 commented 1 year ago

Hi, maybe do you have a documention what the difference between V2 and V3 is and what it means? Does it make sense to update my apps from V2 to V3? I am currently running Jira v9.2.0 and Confluence 7.18.1.

Maybe there is a migration guide for V2 -> V3? My code looks like:

const { Version2Client } = require('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
        }
    }
})

Example call:

async function getIssue(issueKey) {
    let issue

    jiraHelper.setSSLVerification('0')

    await client2.issues
        .getIssue({ issueIdOrKey: issueKey })
        .then((res) => {
            issue = res
            jiraHelper.setSSLVerification('1')
        })
        .catch((res) => {
            jiraHelper.printErrors(res)
            process.exit(1)
        })
    return issue
}

thx

MrRefactoring commented 1 year ago

Hello @shadowempire123! Currently, you are using Jira Standalone (with server API) and we are not planning to support this API. We are supporting only Jira Cloud API.

You can find a more detailed answer here: https://github.com/MrRefactoring/jira.js/issues/252