I'm trying to talk to a self hosted (Server?) jira instance via rest, from a scala /java application.
There's so much clutter out there and a lot of old information.
I'm thinking this should be really simple, and there would be a sample application, that "just works".
I've tried using apache httpclient basic auth, as in this example https://hc.apache.org/httpcomponents-client-4.5.x/httpclient/examples/org/apache/http/examples/client/ClientAuthentication.java
but am getting 400 code returned.
I can request successfully using postman.
I personally use this library and it works fine all the time. kong.github.io/unirest-java
This is really simple to use. Code looks like this,
HttpResponse response = Unirest.get("{jira_url}/rest/api/2/issue/{issueIdOrKey}") .header("Accept", "application/json") .basicAuth("{user_name}", "{password}") .asJson(); System.out.println(response.getBody());
I've also looked at JIRA REST Java Client Library but it seems to be obsolete/ 9 years old!!
Cheers - I'll take a look...
It looks like you're new here. Sign in or register to get started.