Commit 2bcd5d1d authored by 黎博's avatar 黎博

update

parent 00271737
...@@ -31,8 +31,8 @@ public class WebhookServiceImpl implements WebhookService { ...@@ -31,8 +31,8 @@ public class WebhookServiceImpl implements WebhookService {
// BUG创建的时候发送通知 // BUG创建的时候发送通知
if (StringUtils.equals(webhookEvent, "jira:issue_created")) { if (StringUtils.equals(webhookEvent, "jira:issue_created")) {
String title = "线上研发工单提交"; String title = "线上研发工单提交";
String content = creator + "提交了线上研发工单:" + key; String content = creator + "提交了线上研发工单:" + key + "\n\n";
content += "概要:[" + summary + "](" + "http://jira2.quantgroup.cn/browse/" + key + ")"+ "\n\n" content += "概要:[" + summary + "](" + "http://jira2.quantgroup.cn/browse/" + key + ")" + "\n\n"
+ "- 优先级:" + priority + "\n" + "- 优先级:" + priority + "\n"
+ "- 模块:" + module + "\n" + "- 模块:" + module + "\n"
+ "- 经办人:" + assignee + "\n\n"; + "- 经办人:" + assignee + "\n\n";
...@@ -51,21 +51,21 @@ public class WebhookServiceImpl implements WebhookService { ...@@ -51,21 +51,21 @@ public class WebhookServiceImpl implements WebhookService {
switch (eventTypeName) { switch (eventTypeName) {
case "issue_work_started": case "issue_work_started":
// BUG状态变为【处理中】 // BUG状态变为【处理中】
content += "研发工单 " + key + " 状态更新:"; content += "研发工单 " + key + " 状态更新:" + "\n\n";
content += "概要:[" + summary + "](" + issueUrl + ")"+ "\n\n"; content += "概要:[" + summary + "](" + issueUrl + ")"+ "\n\n";
content += "状态变更为:【处理中】\n\n"; content += "状态变更为:【处理中】\n\n";
DingdingUtils.sendToDingding(DingdingUtils.buildMarkdownMsg(title, content, false), webhook); DingdingUtils.sendToDingding(DingdingUtils.buildMarkdownMsg(title, content, false), webhook);
break; break;
case "issue_resolved": case "issue_resolved":
// BUG状态变为【已解决】 // BUG状态变为【已解决】
content += "研发工单 " + key + " 状态更新:"; content += "研发工单 " + key + " 状态更新:" + "\n\n";
content += "概要:[" + summary + "](" + issueUrl + ")"+ "\n\n"; content += "概要:[" + summary + "](" + issueUrl + ")"+ "\n\n";
content += "状态变更为:【已解决】\n\n"; content += "状态变更为:【已解决】\n\n";
DingdingUtils.sendToDingding(DingdingUtils.buildMarkdownMsg(title, content, false), webhook); DingdingUtils.sendToDingding(DingdingUtils.buildMarkdownMsg(title, content, false), webhook);
break; break;
case "issue_reopened": case "issue_reopened":
// BUG状态变为【重新打开】 // BUG状态变为【重新打开】
content += "研发工单 " + key + " 状态更新:"; content += "研发工单 " + key + " 状态更新:" + "\n\n";
content += "概要:[" + summary + "](" + issueUrl + ")"+ "\n\n"; content += "概要:[" + summary + "](" + issueUrl + ")"+ "\n\n";
content += "状态变更为:【重新打开】\n\n"; content += "状态变更为:【重新打开】\n\n";
DingdingUtils.sendToDingding(DingdingUtils.buildMarkdownMsg(title, content, false), webhook); DingdingUtils.sendToDingding(DingdingUtils.buildMarkdownMsg(title, content, false), webhook);
...@@ -76,7 +76,7 @@ public class WebhookServiceImpl implements WebhookService { ...@@ -76,7 +76,7 @@ public class WebhookServiceImpl implements WebhookService {
break; break;
case "issue_commented": case "issue_commented":
// 新增BUG备注 // 新增BUG备注
content += "研发工单 " + key + " 新增备注:"; content += "研发工单 " + key + " 新增备注:" + "\n\n";
content += "概要:[" + summary + "](" + issueUrl + ")"+ "\n\n"; content += "概要:[" + summary + "](" + issueUrl + ")"+ "\n\n";
content += "新增备注:\n\n"; content += "新增备注:\n\n";
content += JsonPath.read(jiraData, "$.comment.body"); content += JsonPath.read(jiraData, "$.comment.body");
...@@ -86,7 +86,7 @@ public class WebhookServiceImpl implements WebhookService { ...@@ -86,7 +86,7 @@ public class WebhookServiceImpl implements WebhookService {
// BUG更新 // BUG更新
String changedField = JsonPath.read(jiraData, "$.changelog.items[0].field"); String changedField = JsonPath.read(jiraData, "$.changelog.items[0].field");
if (StringUtils.equals(changedField, "assignee")) { if (StringUtils.equals(changedField, "assignee")) {
content += "研发工单 " + key + " 经办人变更:"; content += "研发工单 " + key + " 经办人变更:" + "\n\n";
content += "概要:[" + summary + "](" + issueUrl + ")"+ "\n\n"; content += "概要:[" + summary + "](" + issueUrl + ")"+ "\n\n";
content += "- 原经办人:" + JsonPath.read(jiraData, "$.changelog.items[0].fromString") + "\n"; content += "- 原经办人:" + JsonPath.read(jiraData, "$.changelog.items[0].fromString") + "\n";
content += "- 新经办人:" + JsonPath.read(jiraData, "$.changelog.items[0].toString") + "\n"; content += "- 新经办人:" + JsonPath.read(jiraData, "$.changelog.items[0].toString") + "\n";
......
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