Pregunta

Hello I'm trying to update some complex fields such as Issue Type or Status using Jira Rest Client Library for Java and I'm having some trouble. This is what I've got so far:

Issue issue = client.getIssueClient().getIssue(issueKey, null);
client.getIssueClient().update(
        issue,
        ImmutableList.of(new FieldInput(IssueFieldId.ISSUE_TYPE_FIELD,
                        issue.getIssueType())), null);

As you can see I'm only trying to update the issue type using it's own type (just to test it), however I get an Exception:

Exception in thread "main" com.atlassian.jira.rest.client.RestClientException:
org.codehaus.jettison.json.JSONException: Cannot generate value - unknown type for me:
class com.atlassian.jira.rest.client.domain.BasicIssueType

Am I missing something, is there any documentation for this library that I missed?

¿Fue útil?

Solución

I managed to achieve what I was trying to do:

Issue issue = client.getIssueClient().getIssue(issueKey, null);
client.getIssueClient().update(
    issue,
    ImmutableList.of(new FieldInput(IssueFieldId.ISSUE_TYPE_FIELD,
                    ComplexIssueInputFieldValue.with("id", id))), null);

This will change the type of the issue, hope this will help anyone else who encounters this problem.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top