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
2bcd5d1d
Commit
2bcd5d1d
authored
Feb 11, 2022
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
00271737
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
WebhookServiceImpl.java
...cn/qg/holmes/service/quality/impl/WebhookServiceImpl.java
+7
-7
No files found.
src/main/java/cn/qg/holmes/service/quality/impl/WebhookServiceImpl.java
View file @
2bcd5d1d
...
...
@@ -31,8 +31,8 @@ public class WebhookServiceImpl implements WebhookService {
// BUG创建的时候发送通知
if
(
StringUtils
.
equals
(
webhookEvent
,
"jira:issue_created"
))
{
String
title
=
"线上研发工单提交"
;
String
content
=
creator
+
"提交了线上研发工单:"
+
key
;
content
+=
"概要:["
+
summary
+
"]("
+
"http://jira2.quantgroup.cn/browse/"
+
key
+
")"
+
"\n\n"
String
content
=
creator
+
"提交了线上研发工单:"
+
key
+
"\n\n"
;
content
+=
"概要:["
+
summary
+
"]("
+
"http://jira2.quantgroup.cn/browse/"
+
key
+
")"
+
"\n\n"
+
"- 优先级:"
+
priority
+
"\n"
+
"- 模块:"
+
module
+
"\n"
+
"- 经办人:"
+
assignee
+
"\n\n"
;
...
...
@@ -51,21 +51,21 @@ public class WebhookServiceImpl implements WebhookService {
switch
(
eventTypeName
)
{
case
"issue_work_started"
:
// BUG状态变为【处理中】
content
+=
"研发工单 "
+
key
+
" 状态更新:"
;
content
+=
"研发工单 "
+
key
+
" 状态更新:"
+
"\n\n"
;
content
+=
"概要:["
+
summary
+
"]("
+
issueUrl
+
")"
+
"\n\n"
;
content
+=
"状态变更为:【处理中】\n\n"
;
DingdingUtils
.
sendToDingding
(
DingdingUtils
.
buildMarkdownMsg
(
title
,
content
,
false
),
webhook
);
break
;
case
"issue_resolved"
:
// BUG状态变为【已解决】
content
+=
"研发工单 "
+
key
+
" 状态更新:"
;
content
+=
"研发工单 "
+
key
+
" 状态更新:"
+
"\n\n"
;
content
+=
"概要:["
+
summary
+
"]("
+
issueUrl
+
")"
+
"\n\n"
;
content
+=
"状态变更为:【已解决】\n\n"
;
DingdingUtils
.
sendToDingding
(
DingdingUtils
.
buildMarkdownMsg
(
title
,
content
,
false
),
webhook
);
break
;
case
"issue_reopened"
:
// BUG状态变为【重新打开】
content
+=
"研发工单 "
+
key
+
" 状态更新:"
;
content
+=
"研发工单 "
+
key
+
" 状态更新:"
+
"\n\n"
;
content
+=
"概要:["
+
summary
+
"]("
+
issueUrl
+
")"
+
"\n\n"
;
content
+=
"状态变更为:【重新打开】\n\n"
;
DingdingUtils
.
sendToDingding
(
DingdingUtils
.
buildMarkdownMsg
(
title
,
content
,
false
),
webhook
);
...
...
@@ -76,7 +76,7 @@ public class WebhookServiceImpl implements WebhookService {
break
;
case
"issue_commented"
:
// 新增BUG备注
content
+=
"研发工单 "
+
key
+
" 新增备注:"
;
content
+=
"研发工单 "
+
key
+
" 新增备注:"
+
"\n\n"
;
content
+=
"概要:["
+
summary
+
"]("
+
issueUrl
+
")"
+
"\n\n"
;
content
+=
"新增备注:\n\n"
;
content
+=
JsonPath
.
read
(
jiraData
,
"$.comment.body"
);
...
...
@@ -86,7 +86,7 @@ public class WebhookServiceImpl implements WebhookService {
// BUG更新
String
changedField
=
JsonPath
.
read
(
jiraData
,
"$.changelog.items[0].field"
);
if
(
StringUtils
.
equals
(
changedField
,
"assignee"
))
{
content
+=
"研发工单 "
+
key
+
" 经办人变更:"
;
content
+=
"研发工单 "
+
key
+
" 经办人变更:"
+
"\n\n"
;
content
+=
"概要:["
+
summary
+
"]("
+
issueUrl
+
")"
+
"\n\n"
;
content
+=
"- 原经办人:"
+
JsonPath
.
read
(
jiraData
,
"$.changelog.items[0].fromString"
)
+
"\n"
;
content
+=
"- 新经办人:"
+
JsonPath
.
read
(
jiraData
,
"$.changelog.items[0].toString"
)
+
"\n"
;
...
...
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