fix: 缺陷添加创建时间

This commit is contained in:
shiziyuan9527 2020-08-24 16:10:12 +08:00
parent 9ad4da05cd
commit 8fcf7aea75
2 changed files with 13 additions and 2 deletions

View File

@ -310,7 +310,11 @@ public class IssuesService {
return new Issues();
}
JSONObject jsonObject = JSONObject.parseObject(listJson);
return jsonObject.getObject("Bug", Issues.class);
JSONObject bug = jsonObject.getJSONObject("Bug");
Long created = bug.getLong("created");
Issues issues = jsonObject.getObject("Bug", Issues.class);
issues.setCreateTime(created);
return issues;
}
public Issues getJiraIssues(HttpHeaders headers, String url, String issuesId) {
@ -326,15 +330,23 @@ public class IssuesService {
JSONObject obj = JSONObject.parseObject(body);
JSONObject fields = (JSONObject) obj.get("fields");
JSONObject statusObj = (JSONObject) fields.get("status");
JSONObject assignee = (JSONObject) fields.get("assignee");
JSONObject statusCategory = (JSONObject) statusObj.get("statusCategory");
String id = obj.getString("id");
String title = fields.getString("summary");
String description = fields.getString("description");
String status = statusCategory.getString("key");
Long createTime = fields.getLong("created");
String lastmodify = "";
if (assignee != null) {
lastmodify = assignee.getString("displayName");
}
issues.setId(id);
issues.setTitle(title);
issues.setCreateTime(createTime);
issues.setLastmodify(lastmodify);
issues.setDescription(description);
issues.setStatus(status);
issues.setPlatform(IssuesManagePlatform.Jira.toString());

View File

@ -404,7 +404,6 @@
this.activeTab = 'detail';
listenGoBack(this.handleClose);
this.initData(testCase);
this.getIssues(testCase.caseId);
},
initTest() {
this.$nextTick(() => {