fix(测试跟踪): 测试计划报告缺陷列表加载报错

--bug=1018798 --user=陈建星 【测试跟踪】测试计划-查看测试报告-功能用例分析-缺陷列表打不开,报500 https://www.tapd.cn/55049933/s/1275756
This commit is contained in:
chenjianxing 2022-10-25 10:09:34 +08:00 committed by jianxing
parent 7f3dca6d0f
commit 0dc752dd88
1 changed files with 6 additions and 1 deletions

View File

@ -854,6 +854,11 @@ public class IssuesService {
return DistinctKeyUtil.distinctByKey(planIssues, IssuesDao::getId); return DistinctKeyUtil.distinctByKey(planIssues, IssuesDao::getId);
} }
/**
* 获取缺陷状态的自定义字段替换
* @param planIssues
* @param planId
*/
private void replaceStatus(List<IssuesDao> planIssues, String planId) { private void replaceStatus(List<IssuesDao> planIssues, String planId) {
TestPlanWithBLOBs testPlan = testPlanService.get(planId); TestPlanWithBLOBs testPlan = testPlanService.get(planId);
CustomField customField = baseCustomFieldService.getCustomFieldByName(testPlan.getProjectId(), SystemCustomField.ISSUE_STATUS); CustomField customField = baseCustomFieldService.getCustomFieldByName(testPlan.getProjectId(), SystemCustomField.ISSUE_STATUS);
@ -865,7 +870,7 @@ public class IssuesService {
List<CustomFieldOptionDTO> options = JSON.parseArray(customField.getOptions(), CustomFieldOptionDTO.class); List<CustomFieldOptionDTO> options = JSON.parseArray(customField.getOptions(), CustomFieldOptionDTO.class);
for (CustomFieldOptionDTO option : options) { for (CustomFieldOptionDTO option : options) {
String value = field.getValue(); String value = field.getValue();
if (value != null) { if (StringUtils.isNotBlank(value)) {
value = (String) JSON.parseObject(value); value = (String) JSON.parseObject(value);
} }
if (StringUtils.equals(option.getValue(), value)) { if (StringUtils.equals(option.getValue(), value)) {