使用Transition抛出JIRA问题的解决方案抛出异常

时间:2016-11-11 07:05:27

标签: jira jira-plugin jira-rest-api

我有两个JIRA项目,例如。 DEVCLIENT。我想在CLIENT项目中的问题解决方案更改为DONE时,将DEV项目中的问题解决方案设置为DONE

为此,我做了以下代码:

public void changeTransition(com.atlassian.jira.issue.Issue devIssue, Issue clientIssue, JiraRestClient restClient) {
    IssueRestClient issueClient = restClient.getIssueClient();
    Iterable<Transition> transitions = issueClient.getTransitions(clientIssue.getTransitionsUri()).claim();
    final Transition doneIssueTransition = getTransitionByName(transitions, "Done");  //this returns done Transition
    if (doneIssueTransition != null) {
        ImmutableList.Builder<FieldInput> builder = ImmutableList.builder();
        builder.add(new FieldInput(IssueFieldId.RESOLUTION_FIELD, ComplexIssueInputFieldValue.with("name", devIssue.getResolution().getName())));
        ImmutableList<FieldInput> fieldInputs = builder.build();
        TransitionInput transitionInput = new TransitionInput(doneIssueTransition.getId(), fieldInputs, prepareComment(devIssue));
        issueClient.transition(clientIssue.getTransitionsUri(), transitionInput).claim();
    }
}

我得到的例外是:

Field 'resolution' cannot be set. It is not on the appropriate screen, or unknown.

代码有什么问题吗?这个例外意味着什么?我应该做些什么改变才能解决这个问题?

0 个答案:

没有答案