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(),