From 57db8ebd02f21f8103be455b6698b53ee5c451f7 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 14 Jan 2022 10:32:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20jira=E5=90=8C=E6=AD=A5=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E9=87=8D=E5=A4=8D=E7=94=A8=E4=BE=8B=20--bug?= =?UTF-8?q?=3D1009575=20--user=3D=E9=99=88=E5=BB=BA=E6=98=9F=20=E3=80=90?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA=E3=80=91jira=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E7=BC=BA=E9=99=B7=E5=90=8C=E6=AD=A5=E4=BC=9A=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E9=87=8D=E5=A4=8D=E7=BC=BA=E9=99=B7=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E4=B8=94=E5=9C=A8ms=E9=87=8C=E5=88=A0=E9=99=A4=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E4=BC=9A=E5=90=8C=E6=97=B6=E5=88=A0=E6=8E=89jira?= =?UTF-8?q?=E9=87=8C=E7=9A=84=E7=BC=BA=E9=99=B7=20https://www.tapd.cn/5504?= =?UTF-8?q?9933/s/1091677?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/issue/client/JiraAbstractClient.java | 10 ++++++++-- backend/src/main/java/io/metersphere/xpack | 2 +- 2 files changed, 9 insertions(+), 3 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 6b8fc1acc1..be5ef99835 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 @@ -11,6 +11,7 @@ import org.springframework.core.io.FileSystemResource; import org.springframework.http.*; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; +import org.springframework.web.client.HttpClientErrorException; import java.io.File; import java.util.List; @@ -110,10 +111,15 @@ public abstract class JiraAbstractClient extends BaseClient { public void deleteIssue(String id) { LogUtil.info("deleteIssue: " + id); - restTemplate.exchange(getBaseUrl() + "/issue/" + id, HttpMethod.DELETE, getAuthHttpEntity(), String.class); + try { + restTemplate.exchange(getBaseUrl() + "/issue/" + id, HttpMethod.DELETE, getAuthHttpEntity(), String.class); + } catch (HttpClientErrorException e) { + if (e.getRawStatusCode() != 404) {// 404说明jira没有,可以直接删 + MSException.throwException(e.getMessage()); + } + } } - public void uploadAttachment(String issueKey, File file) { HttpHeaders authHeader = getAuthHeader(); authHeader.add("X-Atlassian-Token", "no-check"); diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 7e0cc9ecb9..cf2af85c09 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 7e0cc9ecb9ca9c13edf8b253bcf12515837e5196 +Subproject commit cf2af85c0943c091b1de08a51fa8e0f99a161699