From 540028cdab7ba758a5924071af43c19ced4dacfb Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Wed, 17 Aug 2022 16:00:46 +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=E8=A6=86=E7=9B=96=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E6=97=B6=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E5=80=BC=E5=A4=84=E7=90=86=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1015891 --user=宋昌昌 【项目设置】项目1自定义字段a类型是单选框,项目2自定义字段a类型是输入框,项目1复制缺陷模版选项目2,复制模式覆盖,复制完,项目2的自定义字段类型未覆盖成功 https://www.tapd.cn/55049933/s/1225341 --- .../java/io/metersphere/service/IssueTemplateService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/service/IssueTemplateService.java b/backend/src/main/java/io/metersphere/service/IssueTemplateService.java index 88bc92bb5f..77faebdead 100644 --- a/backend/src/main/java/io/metersphere/service/IssueTemplateService.java +++ b/backend/src/main/java/io/metersphere/service/IssueTemplateService.java @@ -393,7 +393,11 @@ public class IssueTemplateService extends TemplateBaseService { tarCustomField.setCreateUser(SessionUtils.getUserId()); if (StringUtils.equals("1", request.getCopyModel())) { // 覆盖模式 - tarCustomField.setOptions(sourceCustomField.getOptions()); + if (StringUtils.equals(sourceCustomField.getType(), tarCustomField.getType())) { + tarCustomField.setOptions(sourceCustomField.getOptions()); + } else { + tarCustomField.setOptions("[]"); + } customFieldMapper.updateByPrimaryKeyWithBLOBs(tarCustomField); } else { //追加模式