Commit e61def03 authored by 黎博's avatar 黎博

update

parent b1dd51ac
...@@ -13,6 +13,7 @@ public class WebhookServiceImpl implements WebhookService { ...@@ -13,6 +13,7 @@ public class WebhookServiceImpl implements WebhookService {
@Override @Override
public void handleProdJiraBugUpdate(String jiraData) { public void handleProdJiraBugUpdate(String jiraData) {
// 暂时为了测试
String webhook = "https://oapi.dingtalk.com/robot/send?access_token=be220b4bd17f311d70365a0ee81a659b54f06d52f1ee8d4d7d1051a183a266e1"; String webhook = "https://oapi.dingtalk.com/robot/send?access_token=be220b4bd17f311d70365a0ee81a659b54f06d52f1ee8d4d7d1051a183a266e1";
String webhookEvent = JsonPath.read(jiraData, "$.webhookEvent"); String webhookEvent = JsonPath.read(jiraData, "$.webhookEvent");
String eventTypeName = JsonPath.read(jiraData, "$.issue_event_type_name"); String eventTypeName = JsonPath.read(jiraData, "$.issue_event_type_name");
...@@ -28,6 +29,12 @@ public class WebhookServiceImpl implements WebhookService { ...@@ -28,6 +29,12 @@ public class WebhookServiceImpl implements WebhookService {
String priority = JsonPath.read(jiraData, "$.issue.fields.priority.name"); String priority = JsonPath.read(jiraData, "$.issue.fields.priority.name");
String description = JsonPath.read(jiraData, "$.issue.fields.description"); String description = JsonPath.read(jiraData, "$.issue.fields.description");
List<String> attachmentList = JsonPath.read(jiraData, "$.issue.fields.attachment[*].content"); List<String> attachmentList = JsonPath.read(jiraData, "$.issue.fields.attachment[*].content");
// TODO: 2022/2/14
if (StringUtils.equals(key.split("-")[0], "YFGDZZ")) {
// webhook赋值为金融群的机器人地址
} else if (StringUtils.equals(key.split("-")[0], "YXMXS")) {
// webhook赋值为电商群的机器人地址
}
// BUG创建的时候发送通知 // BUG创建的时候发送通知
if (StringUtils.equals(webhookEvent, "jira:issue_created")) { if (StringUtils.equals(webhookEvent, "jira:issue_created")) {
String title = "线上研发工单提交"; String title = "线上研发工单提交";
......
...@@ -73,19 +73,6 @@ public class DingdingUtils { ...@@ -73,19 +73,6 @@ public class DingdingUtils {
return buildMarkdownMsg(title, content, true); return buildMarkdownMsg(title, content, true);
} }
public static String buildProdBugCreateMarkdownMsg(String key, String summary, String creator, String assignee, String priority, String module, List<String> attachmentList) {
String title = "线上研发工单";
String content = creator + "提交了研发工单:" + key;
content += "概要:[" + summary + "](" + "http://jira2.quantgroup.cn/browse/" + key + ")"+ "\n\n"
+ "- 优先级:" + priority + "\n"
+ "- 模块:" + module + "\n"
+ "- 经办人:" + assignee + "\n\n";
for (String attachment: attachmentList) {
content += "![](" + attachment + ")\n" ;
}
return buildMarkdownMsg(title, content, false);
}
/** /**
* for 数据工单 * for 数据工单
* 根据issueList构建未解决issueList的markdown格式 * 根据issueList构建未解决issueList的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