// list中筛选出status为指定条件的项,中key的值 List<String> openJiraList = subTaskList.stream().filter(v -> { String status = v.getFields().getStatus().getName(); if("OPEN".equals(status) || "新创建".equals(status) || "reopen".equals(status) || "重新打开".equals(status) || "开放".equals(status)){ return true; } return false; }).map(IssuesVo.SubTask::getKey).(Collectors.toList());
排序
List<IssuesVo> allIssues = JSON.parseArray(JsonNode.path("issues").toString(), IssuesVo.class);
String res = allIssues.stream().sorted(Comparator.comparing(p -> p.getFields().getPriority().getName())).map(x -> { String p = x.getFields().getPriority().getName(); String key = x.getKey(); String rd = x.getFields().getAssignee().getName(); return "【" + p + "】" + Jira_Base_Url + key + "【RD:" + rd + "】"; }).collect(Collectors.joining("\n"));