我尝试在Testplan中为testcase设置字段。我读取它时得到的值是JSONArray。但是,当我将相同的JSONArray提取到新创建的Testplan时,我得到一个错误消息。
Exception in thread "main" com.atlassian.jira.rest.client.api.domain.input.CannotTransformValueException: Any of available transformers was able to transform given value. Value is: org.codehaus.jettison.json.JSONArray: ["SBNDTST-361","SBNDTST-360","SBNDTST-358","SBNDTST-359"]
at com.atlassian.jira.rest.client.api.domain.input.ValueTransformerManager.apply(ValueTransformerManager.java:83)
at com.atlassian.jira.rest.client.api.domain.input.IssueInputBuilder.setFieldValue(IssueInputBuilder.java:134)
我设置字段的方法是:
public void updateIssue(String issueKey, String fieldId, Object fieldValue) {
IssueInput input = new IssueInputBuilder()
.setFieldValue(fieldId, fieldValue)
.build();
restClient.getIssueClient()
.updateIssue(issueKey, input)
.claim();
fieldId的值为"customfield_17473"。这方面的文件很少。有人知道该怎么做吗?
我通过反复试验找到了解决办法。当我发送一个数组列表时,它会工作。