Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
holmes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
holmes
Commits
e61def03
Commit
e61def03
authored
Feb 11, 2022
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
b1dd51ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
13 deletions
+7
-13
WebhookServiceImpl.java
...cn/qg/holmes/service/quality/impl/WebhookServiceImpl.java
+7
-0
DingdingUtils.java
src/main/java/cn/qg/holmes/utils/DingdingUtils.java
+0
-13
No files found.
src/main/java/cn/qg/holmes/service/quality/impl/WebhookServiceImpl.java
View file @
e61def03
...
@@ -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
=
"线上研发工单提交"
;
...
...
src/main/java/cn/qg/holmes/utils/DingdingUtils.java
View file @
e61def03
...
@@ -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
+=
"\n"
;
}
return
buildMarkdownMsg
(
title
,
content
,
false
);
}
/**
/**
* for 数据工单
* for 数据工单
* 根据issueList构建未解决issueList的markdown格式
* 根据issueList构建未解决issueList的markdown格式
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment