diff --git a/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java b/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java index bf54d1b6ca..3205b7becc 100644 --- a/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java @@ -10,6 +10,7 @@ import io.metersphere.commons.constants.IssuesStatus; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.LogUtil; import io.metersphere.dto.UserDTO; +import io.metersphere.i18n.Translator; import io.metersphere.track.dto.DemandDTO; import io.metersphere.track.issue.client.ZentaoClient; import io.metersphere.track.issue.domain.PlatformUser; @@ -338,9 +339,14 @@ public class ZentaoPlatform extends AbstractIssuePlatform { } public List getBuilds() { - Map builds = zentaoClient.getBuildsByCreateMetaData(getProjectId(projectId)); + String relateProjectId = getProjectId(projectId); + Boolean exist = checkProjectExist(relateProjectId); + if (!exist) { + MSException.throwException(Translator.get("zentao_project_id_not_exist")); + } + Map builds = zentaoClient.getBuildsByCreateMetaData(relateProjectId); if (builds == null || builds.isEmpty()) { - builds = zentaoClient.getBuilds(getProjectId(projectId)); + builds = zentaoClient.getBuilds(relateProjectId); } List res = new ArrayList<>(); builds.forEach((k, v) -> { diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index e7d5b692ea..9e70b2ce43 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -165,6 +165,7 @@ step_model_tip=Step description fill in STEP, text description please fill in TE case_status_not_exist=The use case status must be Prepare, Underway way and Completed issue_project_not_exist=ID does not exist or other errors tapd_project_not_exist=The associated TAPD item ID does not exist +zentao_project_id_not_exist=The associated Zen Tao ID does not exist or other errors #ldap ldap_url_is_null=LDAP address is empty ldap_dn_is_null=LDAP binding DN is empty diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 578568e42f..7dde1c5302 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -165,6 +165,7 @@ step_model_tip=步骤描述填写 STEP,文本描述请填写 TEXT (非必填) case_status_not_exist=用例状态必须为未开始(Prepare)、进行中(Underway)、已完成(Completed) issue_project_not_exist=ID不存在或其它错误 tapd_project_not_exist=关联的TAPD项目ID不存在 +zentao_project_id_not_exist=关联的禅道ID不存在或其它错误 #ldap ldap_url_is_null=LDAP地址为空 ldap_dn_is_null=LDAP绑定DN为空 diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 4200718eac..b1de0dd95f 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -165,6 +165,7 @@ step_model_tip=步驟描述填寫 STEP,文本描述請填寫 TEXT (非必填) case_status_not_exist=用例狀態必須為未開始(Prepare)、進行中(Underway)、已完成(Completed) issue_project_not_exist=ID不存在或其它錯誤 tapd_project_not_exist=關聯的TAPD項目ID不存在 +zentao_project_id_not_exist=關聯的禪道ID不存在或其它錯誤 #ldap ldap_url_is_null=LDAP地址為空 ldap_dn_is_null=LDAP綁定DN為空