MrRefactoring / jira.js

A JavaScript/TypeScript wrapper for the JIRA Cloud, Service Desk and Agile REST API

Home Page:https://mrrefactoring.github.io/jira.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't connect the jira client

IsuruUthpala opened this issue · comments

Having trouble connecting to the client.

I'm getting 400 Bad Request and the response body data property is like below.
version - "jira.js": "^2.15.9"

{
  data: '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\n' +
      '<html><head>\n' +
      '<title>400 Bad Request</title>\n' +
      '</head><body>\n' +
      '<h1>Bad Request</h1>\n' +
      '<p>Your browser sent a request that this server could not understand.<br />\n' +
      '</p>\n' +
      '<hr>\n' +
      '<address>Apache/2.4.29 (Ubuntu) Server at 127.0.1.1 Port 80</address>\n' +
      '</body></html>\n'
  }

This is how i connected to the client.

jiraTicketCLient = new Version2Client({
    host: configuration().app.jira.ticketHost,

    authentication: {
      basic: {
        email: configuration().app.jira.email,
        apiToken: configuration().app.jira.apiToken,
      },
    },
  });

This is my import ;

import { Version2Client } from 'jira.js';

email and the api token are correct and works fine with jira-connector l library

Hello @IsuruUthpala! Which method you have tried to call?

And one more thing. Your host started from http:// or https://? If not then try it

And one more thing. Your host started from http:// or https://? If not then try it

Silly me, I had the host like below (same way as jira-connector)
host: "jenjinstudios.atlassian.net"
Thank you @MrRefactoring

I'm closing this, Since resolved.

I think it makes sense to do some kind of check on the library side, so I'll leave this ticket open for now. In any case, thanks a lot for the report, it's useful