This commit is contained in:
chenjianxing 2020-09-08 17:29:47 +08:00
commit 40780b9158
2 changed files with 18 additions and 4 deletions

View File

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

View File

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