我有两个JIRA项目,例如。 DEV
和CLIENT
。我想在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.
代码有什么问题吗?这个例外意味着什么?我应该做些什么改变才能解决这个问题?