fix: jira同步缺陷出现重复用例

--bug=1009575 --user=陈建星 【测试跟踪】jira平台缺陷同步会出现重复缺陷,并且在ms里删除缺陷会同时删掉jira里的缺陷 https://www.tapd.cn/55049933/s/1091677
This commit is contained in:
chenjianxing 2022-01-14 10:32:18 +08:00 committed by zhangdahai112
parent 6e99229bfc
commit 57db8ebd02
2 changed files with 9 additions and 3 deletions

View File

@ -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");

@ -1 +1 @@
Subproject commit 7e0cc9ecb9ca9c13edf8b253bcf12515837e5196
Subproject commit cf2af85c0943c091b1de08a51fa8e0f99a161699