Commit 11fcdca5 authored by 黎博's avatar 黎博

fix

parent 658bcbd6
...@@ -70,7 +70,7 @@ public class JiraToDingding { ...@@ -70,7 +70,7 @@ public class JiraToDingding {
DateTime endDate = issue.getUpdateDate(); DateTime endDate = issue.getUpdateDate();
int duration = jiraIssueService.calculateBugFixTime(startDate, endDate); int duration = jiraIssueService.calculateBugFixTime(startDate, endDate);
log.info("{} BUG持续时间:{}小时", issue.getKey(), duration); log.info("{} BUG持续时间:{}小时", issue.getKey(), duration);
DingdingUtils.sendToDingding(jiraBugPool.getSummary(), jiraBugPool.getDingUrl()); DingdingUtils.sendToDingding(DingdingUtils.buildBugFixRemindMsg(issue), jiraBugPool.getDingUrl());
// 如果已超过4个小时,则发送钉钉通知 // 如果已超过4个小时,则发送钉钉通知
// if (duration >= 4) { // if (duration >= 4) {
// DingdingUtils.sendToDingding(jiraBugPool.getSummary(), jiraBugPool.getDingUrl()); // DingdingUtils.sendToDingding(jiraBugPool.getSummary(), jiraBugPool.getDingUrl());
......
...@@ -105,6 +105,25 @@ public class DingdingUtils { ...@@ -105,6 +105,25 @@ public class DingdingUtils {
return JSON.toJSONString(markdown); return JSON.toJSONString(markdown);
} }
/**
* 构建BUG fix 提醒消息
* @param issue Jira Issue
* @return
*/
public static String buildBugFixRemindMsg(Issue issue) {
Map<String, Object> markdown = new HashMap<>();
Map<String, String> contentMap = new HashMap<>();
Map<String, Object> atMap = new HashMap<>();
atMap.put("isAtAll", true);
markdown.put("at", atMap);
String content = "亲爱的" + issue.getAssignee().getName() + "同学,你有一个BUG已经超过4个小时未解决,请多注意哦!\n\n";
String bugUrl = "http://jira2.quantgroup.cn/browse/" + issue.getKey();
content += "BUG具体信息:[" + issue.getSummary().replace("\"", "") + "](" + bugUrl + ")\n\n";
contentMap.put("text", content);
markdown.put("markdown", contentMap);
return JSON.toJSONString(markdown);
}
public static void main(String[] args) { public static void main(String[] args) {
// String markdown = buildMarkdownMsg("YXM-1499", "【羊小咩v7.6.00】【VCC首次交易率提升专题】巴拉巴拉", "黎博", "于巧玲", "p1", "kddsp"); // String markdown = buildMarkdownMsg("YXM-1499", "【羊小咩v7.6.00】【VCC首次交易率提升专题】巴拉巴拉", "黎博", "于巧玲", "p1", "kddsp");
// sendToDingding(markdown, "https://oapi.dingtalk.com/robot/send?access_token=835663338d638e40daaf3ab358af741ef0680a826a962c91bedc53b149d85ee1"); // sendToDingding(markdown, "https://oapi.dingtalk.com/robot/send?access_token=835663338d638e40daaf3ab358af741ef0680a826a962c91bedc53b149d85ee1");
......
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