fix(测试跟踪): Jira同步经办人及项目集字段有误 (#18280)
--bug=1017197 --user=宋昌昌 【测试跟踪】github #17764,MS和Jira集成已经成功,在MS中创建缺陷,拉取的Jira缺陷模板,少一个自定义字段【项目集】,其他的自定义字段都可以拉取到。 https://www.tapd.cn/55049933/s/1252392 Co-authored-by: song-cc-rock <changchang.song@fit2cloud.com>
This commit is contained in:
parent
67d47348d7
commit
5a8cb928aa
|
@ -419,7 +419,11 @@ public abstract class AbstractIssuePlatform implements IssuesPlatform {
|
|||
Object value = issue.get(fieldName);
|
||||
if (value != null) {
|
||||
if (value instanceof JSONObject) {
|
||||
item.setValue(getSyncJsonParamValue(value));
|
||||
if (StringUtils.equals(fieldName, "assignee")) {
|
||||
item.setValue(((JSONObject) value).get("displayName"));
|
||||
} else {
|
||||
item.setValue(getSyncJsonParamValue(value));
|
||||
}
|
||||
} else if (value instanceof JSONArray) {
|
||||
List<Object> values = new ArrayList<>();
|
||||
((JSONArray)value).forEach(attr -> {
|
||||
|
|
|
@ -27,6 +27,7 @@ import io.metersphere.track.request.testcase.IssuesUpdateRequest;
|
|||
import io.metersphere.track.service.IssuesService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.client.HttpClientErrorException;
|
||||
|
@ -411,21 +412,26 @@ public class JiraPlatform extends AbstractIssuePlatform {
|
|||
private void parseCustomFiled(IssuesUpdateRequest issuesRequest, List<CustomFieldItemDTO> customFields, JSONObject fields) {
|
||||
customFields.forEach(item -> {
|
||||
String fieldName = item.getCustomData();
|
||||
String name = item.getName();
|
||||
if (StringUtils.isNotBlank(fieldName)) {
|
||||
if (item.getValue() != null) {
|
||||
if (ObjectUtils.isNotEmpty(item.getValue())) {
|
||||
if (StringUtils.isNotBlank(item.getType())) {
|
||||
if (StringUtils.equalsAny(item.getType(), "select", "radio", "member")) {
|
||||
JSONObject param = new JSONObject();
|
||||
if (fieldName.equals("assignee") || fieldName.equals("reporter")) {
|
||||
if (issuesRequest.isThirdPartPlatform()) {
|
||||
param.put("id", item.getValue());
|
||||
} else {
|
||||
param.put("name", item.getValue());
|
||||
}
|
||||
if (StringUtils.equalsAnyIgnoreCase(name, "PML", "PMLinkTest", "PMLink")) {
|
||||
fields.put(fieldName, item.getValue());
|
||||
} else {
|
||||
param.put("id", item.getValue());
|
||||
JSONObject param = new JSONObject();
|
||||
if (fieldName.equals("assignee") || fieldName.equals("reporter")) {
|
||||
if (issuesRequest.isThirdPartPlatform()) {
|
||||
param.put("id", item.getValue());
|
||||
} else {
|
||||
param.put("accountId", item.getValue());
|
||||
}
|
||||
} else {
|
||||
param.put("id", item.getValue());
|
||||
}
|
||||
fields.put(fieldName, param);
|
||||
}
|
||||
fields.put(fieldName, param);
|
||||
} else if (StringUtils.equalsAny(item.getType(), "multipleSelect", "checkbox", "multipleMember")) {
|
||||
JSONArray attrs = new JSONArray();
|
||||
if (item.getValue() != null) {
|
||||
|
|
Loading…
Reference in New Issue