Project

General

Profile

Java Rest API, unable to fetch issue by issue id

Added by Swapnil Inamdar about 8 years ago

Hi All,

I have requirement to get issue details like 'subject', 'created date' and other custom fields, based on issue id, through java rest api. I have a running java program which fetches issues by query id.

Java rest api verion is 2.2.0

But I am unable to get below code working, any help, is appreciated.

mgr.getIssueManager().getIssueById(123); which throws below exception

com.taskadapter.redmineapi.NotFoundException: Server returned '404 not found'. response body:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
<title>Redmine 404 error</title>
<style>
body{
font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
color:#303030;
margin:10px;
}
h1{
font-size:1.5em;
}
p{
font-size:0.8em;
}
</style>
<body>
  <h1>Page not found</h1>
  <p>The page you were trying to access doesn't exist or has been removed.</p>
  <p><a href="javascript:history.back()">Back</a></p>
</body>
</html>

    at com.taskadapter.redmineapi.internal.comm.redmine.RedmineErrorHandler.processContent(RedmineErrorHandler.java:45)
    at com.taskadapter.redmineapi.internal.comm.redmine.RedmineErrorHandler.processContent(RedmineErrorHandler.java:21)
    at com.taskadapter.redmineapi.internal.comm.ComposingHandler.processContent(ComposingHandler.java:25)
    at com.taskadapter.redmineapi.internal.comm.ComposingHandler.processContent(ComposingHandler.java:25)
    at com.taskadapter.redmineapi.internal.comm.BaseCommunicator.sendRequest(BaseCommunicator.java:47)
    at com.taskadapter.redmineapi.internal.comm.redmine.RedmineAuthenticator.sendRequest(RedmineAuthenticator.java:52)
    at com.taskadapter.redmineapi.internal.comm.FmapCommunicator.sendRequest(FmapCommunicator.java:26)
    at com.taskadapter.redmineapi.internal.comm.FmapCommunicator.sendRequest(FmapCommunicator.java:26)
    at com.taskadapter.redmineapi.internal.comm.BasicSimplifier.sendRequest(BasicSimplifier.java:24)
    at com.taskadapter.redmineapi.internal.Transport.send(Transport.java:559)
    at com.taskadapter.redmineapi.internal.Transport.getObject(Transport.java:327)
    at com.taskadapter.redmineapi.internal.Transport.getObject(Transport.java:390)
    at com.taskadapter.redmineapi.IssueManager.getIssueById(IssueManager.java:100)
    at com.swap.red01.LoginAPIKey.getIssuebyStringID(LoginAPIKey.java:27)
    at com.swap.red01.ReadProperties.main(ReadProperties.java:21)

Regards
Swapnil

Replies (1)

RE: Java Rest API, unable to fetch issue by issue id - Added by Alex Last over 5 years ago

check your redmine URL
check your permissions
check if REST API is enabled in your Redmine install.
these are 3 possible options.

    (1-1/1)