I’m working with JIRA REST API for the first time and running into issues when trying to get ticket details from our server. I followed some online documentation but keep getting a 404 response.
public class TicketRetriever {
public static void main(String[] args) throws URISyntaxException {
final JerseyJiraRestClientFactory clientFactory = new JerseyJiraRestClientFactory();
final URI serverUri = new URI("http://jira.mycompany.net:8080/jira/");
final JiraRestClient jiraClient = clientFactory.createWithBasicHttpAuthentication(serverUri, "username", "password");
final NullProgressMonitor monitor = new NullProgressMonitor();
final Issue ticket = jiraClient.getIssueClient().getIssue("PRJ-789012", monitor);
System.out.println(ticket);
}
}
The error I get looks like this:
Exception in thread "main" com.atlassian.jira.rest.client.RestClientException: com.sun.jersey.api.client.UniformInterfaceException: Client response status: 404
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:70)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.getAndParse(AbstractJerseyRestClient.java:80)
I need to use VPN to connect to our JIRA server or else I get connection errors. Could this be a URL formatting issue or maybe I need different authentication? Any ideas what might cause this 404 response?