From 46d86b7f08d0eef522615eea2953d98d18221d70 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 2 Dec 2020 16:38:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20TA?= =?UTF-8?q?PD=E7=BC=BA=E9=99=B7=E7=8A=B6=E6=80=81=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=B8=BA=E5=B7=A5=E4=BD=9C=E6=B5=81=E4=B8=AD=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/track/issue/TapdPlatform.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backend/src/main/java/io/metersphere/track/issue/TapdPlatform.java b/backend/src/main/java/io/metersphere/track/issue/TapdPlatform.java index 2b01f5b468..aff4db0543 100644 --- a/backend/src/main/java/io/metersphere/track/issue/TapdPlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/TapdPlatform.java @@ -21,6 +21,7 @@ import org.springframework.web.client.RestTemplate; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.UUID; import java.util.stream.Collectors; @@ -74,6 +75,16 @@ public class TapdPlatform extends AbstractIssuePlatform { JSONObject bug = jsonObject.getJSONObject("Bug"); Long created = bug.getLong("created"); Issues issues = jsonObject.getObject("Bug", Issues.class); + + // 获取工作流中缺陷状态名称 + String workflow = "https://api.tapd.cn/workflows/status_map?workspace_id=" + projectId + "&system=bug"; + ResultHolder resultHolder = call(workflow); + String workflowJson = JSON.toJSONString(resultHolder.getData()); + if (!StringUtils.equals(Boolean.FALSE.toString(), workflowJson)) { + Map map = (Map) JSONObject.parse(workflowJson); + issues.setStatus((String) map.get(issues.getStatus())); + } + issues.setCreateTime(created); return issues; }