Commit c5d0f680 authored by 黎博's avatar 黎博

修改bug pool扫描提醒

parent 6b74fed2
......@@ -78,7 +78,7 @@ public class JiraToDingding {
// DingdingUtils.sendToDingding(DingdingUtils.buildBugFixRemindMsg(issue), jiraBugPool.getDingUrl());
// 如果已超过4个小时,则发送钉钉通知
if (duration >= 4) {
DingdingUtils.sendToDingding(DingdingUtils.buildBugFixRemindMsg(issue), "https://oapi.dingtalk.com/robot/send?access_token=835663338d638e40daaf3ab358af741ef0680a826a962c91bedc53b149d85ee1");
DingdingUtils.sendToDingding(DingdingUtils.buildBugFixRemindMsg(issue, duration), "https://oapi.dingtalk.com/robot/send?access_token=835663338d638e40daaf3ab358af741ef0680a826a962c91bedc53b149d85ee1");
}
}
}
......
......@@ -110,7 +110,14 @@ public class DingdingUtils {
* @param issue Jira Issue
* @return
*/
public static String buildBugFixRemindMsg(Issue issue) {
public static String buildBugFixRemindMsg(Issue issue, Integer elapsed) {
String duration = "";
if (elapsed >= 4 && elapsed <8) {
duration = elapsed.toString() + "小时";
}
if (elapsed >= 8) {
duration = (elapsed / 8) + "天";
}
Map<String, Object> markdown = new HashMap<>();
Map<String, String> contentMap = new HashMap<>();
Map<String, Object> atMap = new HashMap<>();
......@@ -118,11 +125,12 @@ public class DingdingUtils {
markdown.put("at", atMap);
markdown.put("msgtype", "markdown");
contentMap.put("title", "BUG修复提醒");
String content = "亲爱的" + issue.getAssignee().getDisplayName() + "同学,你有一个BUG已经超过4个小时未解决,请多注意哦!\n\n";
String content = issue.getAssignee().getDisplayName() + "同学,你有一个BUG已经超过" + duration + "未解决,请多注意哦!\n\n";
String bugUrl = "http://jira2.quantgroup.cn/browse/" + issue.getKey();
content += "BUG具体信息:\n\n";
content += "- 标题:[" + issue.getSummary().replace("\"", "") + "](" + bugUrl + ")\n";
content += "- 优先级:" + issue.getPriority().getName() + "\n";
content += "- 经办人:" + issue.getAssignee().getDisplayName() + "\n\n";
contentMap.put("text", content);
markdown.put("markdown", contentMap);
return JSON.toJSONString(markdown);
......
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