fix(测试跟踪): 功能用例的自定义字段导出失败

--bug=1015705 --user=陈建星 【测试跟踪】github #16739,用例的自定义字段不能导出 https://www.tapd.cn/55049933/s/1221273
This commit is contained in:
chenjianxing 2022-08-09 18:34:03 +08:00 committed by jianxing
parent 0ff936b802
commit 70058258e8
1 changed files with 6 additions and 4 deletions

View File

@ -1667,16 +1667,18 @@ public class TestCaseService {
CustomFieldResource field = fields.get(index); CustomFieldResource field = fields.get(index);
//进行key value对换 //进行key value对换
String id = field.getFieldId(); String id = field.getFieldId();
String value = JSONObject.parse(field.getValue()).toString(); if (StringUtils.isNotBlank(field.getValue())) {
if (customSelectValueMap.containsKey(id)) { String value = JSONObject.parse(field.getValue()).toString();
if (customSelectValueMap.get(id).containsKey(value)) { if (customSelectValueMap.containsKey(id)
&& customSelectValueMap.get(id).containsKey(value)) {
value = customSelectValueMap.get(id).get(value); value = customSelectValueMap.get(id).get(value);
} }
map.put(customNameMap.get(id), value);
} }
map.put(customNameMap.get(id), value);
} }
data.setCustomDatas(map); data.setCustomDatas(map);
} catch (Exception e) { } catch (Exception e) {
LogUtil.error(e);
} }
list.add(data); list.add(data);
}); });