fix: 获取jira缺陷时出现空指针的问题
This commit is contained in:
parent
306773ddcd
commit
34bf64ce73
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue