From a8d81d9ad5248caac5638d998b62de6dca8f3e17 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Thu, 20 Oct 2022 15:15:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E6=A8=A1=E6=9D=BF=E5=A4=8D=E5=88=B6=E6=97=B6?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E6=9C=AA=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1018450 --user=宋昌昌 【项目设置】模版管理-缺陷管理-复制缺陷模版到项目B,模版中的字段默认值未复制到项目B的模版中 https://www.tapd.cn/55049933/s/1269595 --- .../java/io/metersphere/service/IssueTemplateService.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/project-management/backend/src/main/java/io/metersphere/service/IssueTemplateService.java b/project-management/backend/src/main/java/io/metersphere/service/IssueTemplateService.java index f019a12b85..f36d1905e2 100644 --- a/project-management/backend/src/main/java/io/metersphere/service/IssueTemplateService.java +++ b/project-management/backend/src/main/java/io/metersphere/service/IssueTemplateService.java @@ -360,6 +360,7 @@ public class IssueTemplateService extends TemplateBaseService { issueTemplateRecord.setUpdateTime(System.currentTimeMillis()); issueTemplateRecord.setCreateUser(SessionUtils.getUserId()); issueTemplateRecord.setProjectId(targetProjectId); + issueTemplateRecord.setGlobal(false); issueTemplateRecords.add(issueTemplateRecord); // 根据复制模式设置自定义字段 sourceCustomFieldTemplates.forEach(sourceCustomFieldTemplate -> { @@ -430,13 +431,6 @@ public class IssueTemplateService extends TemplateBaseService { tarCustomFieldTemplate.setId(UUID.randomUUID().toString()); tarCustomFieldTemplate.setFieldId(tarCustomField.getId()); tarCustomFieldTemplate.setTemplateId(issueTemplateRecord.getId()); - String defaultValue; - if (sourceCustomFieldTemplate.getDefaultValue() != null && tarCustomField.getOptions().contains(sourceCustomFieldTemplate.getDefaultValue())) { - defaultValue = sourceCustomFieldTemplate.getDefaultValue(); - } else { - defaultValue = StringUtils.EMPTY; - } - tarCustomFieldTemplate.setDefaultValue(defaultValue); customFieldTemplateRecords.add(tarCustomFieldTemplate); }); });