Commit 27e6d479 authored by chenjianxing's avatar chenjianxing Committed by jianxing
Browse files

refactor: 创建jira缺陷经办人使用name而不是id

parent fa5a459f
Showing with 10 additions and 5 deletions
+10 -5
......@@ -229,13 +229,18 @@ public class JiraPlatform extends AbstractIssuePlatform {
jiraClientV2.setConfig(config);
customFields.forEach(item -> {
if (StringUtils.isNotBlank(item.getCustomData())) {
String fieldName = item.getCustomData();
if (StringUtils.isNotBlank(fieldName)) {
if (StringUtils.isNotBlank(item.getValue())) {
if (StringUtils.isNotBlank(item.getType()) &&
StringUtils.equalsAny(item.getType(), "select", "radio", "member")) {
JSONObject param = new JSONObject();
param.put("id", item.getValue());
fields.put(item.getCustomData(), param);
if (fieldName.equals("assignee") || fieldName.equals("reporter")) {
param.put("name", item.getValue());
} else {
param.put("id", item.getValue());
}
fields.put(fieldName, param);
} else if (StringUtils.isNotBlank(item.getType()) &&
StringUtils.equalsAny(item.getType(), "multipleSelect", "checkbox", "multipleMember")) {
JSONArray attrs = new JSONArray();
......@@ -247,9 +252,9 @@ public class JiraPlatform extends AbstractIssuePlatform {
attrs.add(param);
});
}
fields.put(item.getCustomData(), attrs);
fields.put(fieldName, attrs);
} else {
fields.put(item.getCustomData(), item.getValue());
fields.put(fieldName, item.getValue());
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment