Commit fdc7893c authored by 黎博's avatar 黎博

兼容BUG未分配的情况

parent 80bc7296
......@@ -200,7 +200,11 @@ public class JiraController {
map.put("key", issue.getKey());
map.put("summary", issue.getSummary());
map.put("reporter", issue.getReporter().getDisplayName());
map.put("assignee", issue.getAssignee().getDisplayName());
if (issue.getAssignee() != null) {
map.put("assignee", issue.getAssignee().getDisplayName());
} else {
map.put("assignee", "未分配");
}
map.put("priority", issue.getPriority().getName());
map.put("status", issue.getStatus().getName());
mapList.add(map);
......
......@@ -31,7 +31,12 @@ public class DingRobotServiceImpl extends ServiceImpl<DingRobotMapper, DingRobot
String webhookEvent = JsonPath.read(jiraData, "$.webhookEvent");
if (StringUtils.equals(webhookEvent, "jira:issue_created")) {
String creator = JsonPath.read(jiraData, "$.issue.fields.creator.displayName");
String assignee = JsonPath.read(jiraData, "$.issue.fields.assignee.displayName");
String assignee = "";
if (JsonPath.read(jiraData, "$.issue.fields.assignee") == null) {
assignee = "未分配";
} else {
assignee = JsonPath.read(jiraData, "$.issue.fields.assignee.displayName");
}
String key = JsonPath.read(jiraData, "$.issue.key");
String summary = JsonPath.read(jiraData, "$.issue.fields.summary");
String priority = JsonPath.read(jiraData, "$.issue.fields.priority.name");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment