From 112e22afa447dc997ca80074842f9ec2948b3b0c Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 23 Nov 2022 17:05:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20ji?= =?UTF-8?q?ra=E6=8F=92=E4=BB=B6jiraKey=E5=85=BC=E5=AE=B9=E6=80=A7=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=1020151 --user=陈建星 【测试跟踪】测试计划-功能用例-脑图/列表-添加jira缺陷报错 https://www.tapd.cn/55049933/s/1303056 --- .../src/business/home/ProjectPlatformConfig.vue | 2 +- .../service/PlatformPluginService.java | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/project-management/frontend/src/business/home/ProjectPlatformConfig.vue b/project-management/frontend/src/business/home/ProjectPlatformConfig.vue index 4bfb048e5a..a9fcf781fd 100644 --- a/project-management/frontend/src/business/home/ProjectPlatformConfig.vue +++ b/project-management/frontend/src/business/home/ProjectPlatformConfig.vue @@ -109,7 +109,7 @@ export default { check() { validateProjectConfig(this.config.id, this.form) .then(() => { - this.$success(this.$t("system.check_third_project_success")); + this.$success(this.$t("pj.check_third_project_success")); }); }, validate() { diff --git a/test-track/backend/src/main/java/io/metersphere/service/PlatformPluginService.java b/test-track/backend/src/main/java/io/metersphere/service/PlatformPluginService.java index 0d127abe74..71ae6f60cd 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/PlatformPluginService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/PlatformPluginService.java @@ -101,14 +101,21 @@ public class PlatformPluginService { public static String getCompatibleProjectConfig(Project project) { String issueConfig = project.getIssueConfig(); Map map = JSON.parseMap(issueConfig); - map.put("jiraKey", project.getJiraKey()); - map.put("tapdId", project.getTapdId()); - map.put("azureDevopsId", project.getAzureDevopsId()); - map.put("zentaoId", project.getZentaoId()); + compatibleProjectKey(map, "jiraKey", project.getJiraKey()); + compatibleProjectKey(map, "tapdId", project.getTapdId()); + compatibleProjectKey(map, "azureDevopsId", project.getAzureDevopsId()); + compatibleProjectKey(map, "zentaoId", project.getZentaoId()); map.put("thirdPartTemplate", project.getThirdPartTemplate()); return JSON.toJSONString(map); } + private static void compatibleProjectKey(Map map, String name, String compatibleValue) { + if (map.get(name) == null || StringUtils.isBlank(map.get(name).toString())) { + // 如果配置里面缺陷对应平台的项目ID则,即使用旧数据的项目ID + map.put(name, compatibleValue); + } + } + public static boolean isPluginPlatform(String platform) { if (StringUtils.equalsAnyIgnoreCase(platform, IssuesManagePlatform.Tapd.name(), IssuesManagePlatform.AzureDevops.name(),