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

Can't connect the jira client #235

Closed
IsuruUthpala opened this issue Sep 13, 2022 · 5 comments · Fixed by #236
Closed

Can't connect the jira client #235

IsuruUthpala opened this issue Sep 13, 2022 · 5 comments · Fixed by #236
Labels
enhancement Denotes a suggestion or request aimed at improving or adding new features to the project.

Comments

@IsuruUthpala
Copy link

IsuruUthpala commented Sep 13, 2022

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

@MrRefactoring
Copy link
Owner

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

@MrRefactoring
Copy link
Owner

MrRefactoring commented Sep 13, 2022

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

@IsuruUthpala
Copy link
Author

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

@IsuruUthpala
Copy link
Author

I'm closing this, Since resolved.

@MrRefactoring
Copy link
Owner

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

@MrRefactoring MrRefactoring reopened this Sep 14, 2022
@MrRefactoring MrRefactoring added the enhancement Denotes a suggestion or request aimed at improving or adding new features to the project. label Sep 14, 2022
@MrRefactoring MrRefactoring linked a pull request Sep 15, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Denotes a suggestion or request aimed at improving or adding new features to the project.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants