From 56f7bd69766bb4af2ce8869e8ef716135cfd9716 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Thu, 21 Nov 2024 17:14:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=BC=BA=E9=99=B7=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E7=9A=84=E5=A4=84=E7=90=86=E4=BA=BA?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1049288 --user=宋昌昌 【缺陷管理】缺陷-集成禅道-自定义禅道模板-创建缺陷成功后查看处理人为空 https://www.tapd.cn/55049933/s/1614574 --- .../metersphere/bug/service/BugService.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java index 8d42ee5055..83fcde2a94 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java @@ -892,7 +892,17 @@ public class BugService { attachTemplateStatusField(templateDTO, projectId, fromStatusId, platformBugKey, showLocal); // 内置字段(处理人字段) - if (!StringUtils.equals(platformName, BugPlatform.LOCAL.getName()) && BooleanUtils.isFalse(showLocal)) { + if (StringUtils.equals(platformName, BugPlatform.LOCAL.getName()) || BooleanUtils.isTrue(showLocal)) { + // Local(处理人) + TemplateCustomFieldDTO handleUserField = new TemplateCustomFieldDTO(); + handleUserField.setFieldId(BugTemplateCustomField.HANDLE_USER.getId()); + handleUserField.setFieldName(BugTemplateCustomField.HANDLE_USER.getName()); + handleUserField.setFieldKey(BugTemplateCustomField.HANDLE_USER.getId()); + handleUserField.setType(CustomFieldType.SELECT.name()); + handleUserField.setOptions(getMemberOption(projectId)); + handleUserField.setRequired(true); + templateDTO.getCustomFields().addFirst(handleUserField); + } else { // 获取插件中自定义的注入字段(处理人) ServiceIntegration serviceIntegration = projectApplicationService.getPlatformServiceIntegrationWithSyncOrDemand(projectId, true); // 状态选项获取时, 获取平台校验了服务集成配置, 所以此处不需要再次校验 @@ -921,16 +931,6 @@ public class BugService { } templateDTO.getCustomFields().addFirst(templateCustomFieldDTO); } - } else { - // Local(处理人) - TemplateCustomFieldDTO handleUserField = new TemplateCustomFieldDTO(); - handleUserField.setFieldId(BugTemplateCustomField.HANDLE_USER.getId()); - handleUserField.setFieldName(BugTemplateCustomField.HANDLE_USER.getName()); - handleUserField.setFieldKey(BugTemplateCustomField.HANDLE_USER.getId()); - handleUserField.setType(CustomFieldType.SELECT.name()); - handleUserField.setOptions(getMemberOption(projectId)); - handleUserField.setRequired(true); - templateDTO.getCustomFields().addFirst(handleUserField); } // 成员类型的自定义字段, 选项值为项目下成员用户