refactor: 创建jira缺陷经办人使用name而不是id
This commit is contained in:
parent
e533964194
commit
744b9895d5
|
@ -251,13 +251,18 @@ public class JiraPlatform extends AbstractIssuePlatform {
|
||||||
jiraClientV2.setConfig(config);
|
jiraClientV2.setConfig(config);
|
||||||
|
|
||||||
customFields.forEach(item -> {
|
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.getValue())) {
|
||||||
if (StringUtils.isNotBlank(item.getType()) &&
|
if (StringUtils.isNotBlank(item.getType()) &&
|
||||||
StringUtils.equalsAny(item.getType(), "select", "radio", "member")) {
|
StringUtils.equalsAny(item.getType(), "select", "radio", "member")) {
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("id", item.getValue());
|
if (fieldName.equals("assignee") || fieldName.equals("reporter")) {
|
||||||
fields.put(item.getCustomData(), param);
|
param.put("name", item.getValue());
|
||||||
|
} else {
|
||||||
|
param.put("id", item.getValue());
|
||||||
|
}
|
||||||
|
fields.put(fieldName, param);
|
||||||
} else if (StringUtils.isNotBlank(item.getType()) &&
|
} else if (StringUtils.isNotBlank(item.getType()) &&
|
||||||
StringUtils.equalsAny(item.getType(), "multipleSelect", "checkbox", "multipleMember")) {
|
StringUtils.equalsAny(item.getType(), "multipleSelect", "checkbox", "multipleMember")) {
|
||||||
JSONArray attrs = new JSONArray();
|
JSONArray attrs = new JSONArray();
|
||||||
|
@ -269,9 +274,9 @@ public class JiraPlatform extends AbstractIssuePlatform {
|
||||||
attrs.add(param);
|
attrs.add(param);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
fields.put(item.getCustomData(), attrs);
|
fields.put(fieldName, attrs);
|
||||||
} else {
|
} else {
|
||||||
fields.put(item.getCustomData(), item.getValue());
|
fields.put(fieldName, item.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue