我有 Jira Rest Client API 的问题。我使用 addWorkLog 遇到异常:
com.atlassian.jira.rest.client.RestClientException:
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:68)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.post(AbstractJerseyRestClient.java:135)
at com.atlassian.jira.rest.client.internal.jersey.JerseyIssueRestClient.addWorklog(JerseyIssueRestClient.java:451)
at ConexionJira.main(ConexionJira.java:273)
Caused by: com.sun.jersey.api.client.UniformInterfaceException: Client response status: 404
at com.sun.jersey.api.client.WebResource.voidHandle(WebResource.java:707)
at com.sun.jersey.api.client.WebResource.post(WebResource.java:236)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient$6.call(AbstractJerseyRestClient.java:141)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient$6.call(AbstractJerseyRestClient.java:135)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:54)
我的代码是下一个:
public static void main (String[] args) throws URISyntaxException{
JerseyJiraRestClientFactory factory = new JerseyJiraRestClientFactory();
URI jiraServerUri = new URI("http://web.web.com/jira");
JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, "asd", "asd");
IssueRestClient irc = restClient.getIssueClient();
NullProgressMonitor pm = new NullProgressMonitor();
WorklogInput worklogInput = new WorklogInputBuilder(tarea.getSelf())
.setStartDate(new DateTime())
.setComment("Comment for my worklog.")
.setMinutesSpent(1)
.build();
Issue issue = restClient.getIssueClient().getIssue("ISSUE", pm);
irc.addWorklog(issue.getWorklogUri(), worklogInput , pm);
有人可以帮我吗?谢谢。