diff --git a/backend/src/main/java/io/metersphere/track/service/IssuesService.java b/backend/src/main/java/io/metersphere/track/service/IssuesService.java index 76e55cf953..d57d482ef0 100644 --- a/backend/src/main/java/io/metersphere/track/service/IssuesService.java +++ b/backend/src/main/java/io/metersphere/track/service/IssuesService.java @@ -346,10 +346,19 @@ public class IssuesService { String body = responseEntity.getBody(); JSONObject obj = JSONObject.parseObject(body); + LogUtil.info(obj); + + String lastmodify = ""; + String status = ""; + JSONObject fields = (JSONObject) obj.get("fields"); JSONObject statusObj = (JSONObject) fields.get("status"); JSONObject assignee = (JSONObject) fields.get("assignee"); - JSONObject statusCategory = (JSONObject) statusObj.get("statusCategory"); + + if (statusObj != null) { + JSONObject statusCategory = (JSONObject) statusObj.get("statusCategory"); + status = statusCategory.getString("key"); + } String id = obj.getString("id"); String title = fields.getString("summary"); @@ -360,9 +369,8 @@ public class IssuesService { HtmlRenderer renderer = HtmlRenderer.builder().build(); description = renderer.render(document); - String status = statusCategory.getString("key"); Long createTime = fields.getLong("created"); - String lastmodify = ""; + if (assignee != null) { lastmodify = assignee.getString("displayName"); } diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 97224cec72..314ac151e3 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -384,7 +384,13 @@ public class TestCaseService { data.setPrerequisite(t.getPrerequisite()); if (t.getMethod().equals("manual")) { String steps = t.getSteps(); - JSONArray jsonArray = JSON.parseArray(steps); + String setp = ""; + if (steps.contains("null")) { + setp = steps.replace("null", ""); + } else { + setp = steps; + } + JSONArray jsonArray = JSON.parseArray(setp); for (int j = 0; j < jsonArray.size(); j++) { int num = j + 1; step.append(num + "." + jsonArray.getJSONObject(j).getString("desc") + "\n");