From cce355912905ebe80936a1c4b2a87ea16634dafe Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 10 Feb 2022 11:47:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=9D=9ESass=E7=89=88Jira=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=B8=8D=E5=88=B0=E9=97=AE=E9=A2=98=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/track/issue/client/JiraAbstractClient.java | 6 ++++++ .../track/issue/domain/jira/JiraIssueProject.java | 3 +++ .../project/menu/components/ProjectJiraConfig.vue | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java b/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java index 7e9ceb9a45..b79d5b7141 100644 --- a/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java +++ b/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java @@ -61,6 +61,12 @@ public abstract class JiraAbstractClient extends BaseClient { ResponseEntity response = null; try { response = restTemplate.exchange(url, HttpMethod.GET, getAuthHttpEntity(), String.class, project.getId()); + } catch (HttpClientErrorException e) { + if (e.getRawStatusCode() == 404) { // Sass 的jira才有这个接口,报错则调用其他接口 + return this.getProject(projectKey).getIssueTypes(); + } + LogUtil.error(e.getMessage(), e); + MSException.throwException(e.getMessage()); } catch (Exception e) { LogUtil.error(e.getMessage(), e); MSException.throwException(e.getMessage()); diff --git a/backend/src/main/java/io/metersphere/track/issue/domain/jira/JiraIssueProject.java b/backend/src/main/java/io/metersphere/track/issue/domain/jira/JiraIssueProject.java index 35ed5159ee..320dc786fd 100644 --- a/backend/src/main/java/io/metersphere/track/issue/domain/jira/JiraIssueProject.java +++ b/backend/src/main/java/io/metersphere/track/issue/domain/jira/JiraIssueProject.java @@ -3,10 +3,13 @@ package io.metersphere.track.issue.domain.jira; import lombok.Getter; import lombok.Setter; +import java.util.List; + @Getter @Setter public class JiraIssueProject { private String id; private String name; private String key; + private List issueTypes; } diff --git a/frontend/src/business/components/project/menu/components/ProjectJiraConfig.vue b/frontend/src/business/components/project/menu/components/ProjectJiraConfig.vue index 155c9a3e8d..446e8ced42 100644 --- a/frontend/src/business/components/project/menu/components/ProjectJiraConfig.vue +++ b/frontend/src/business/components/project/menu/components/ProjectJiraConfig.vue @@ -10,13 +10,13 @@ - + - +