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
c5d0f680
Commit
c5d0f680
authored
May 27, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug pool扫描提醒
parent
6b74fed2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
JiraToDingding.java
src/main/java/cn/qg/holmes/task/jira/JiraToDingding.java
+1
-1
DingdingUtils.java
src/main/java/cn/qg/holmes/utils/DingdingUtils.java
+10
-2
No files found.
src/main/java/cn/qg/holmes/task/jira/JiraToDingding.java
View file @
c5d0f680
...
...
@@ -78,7 +78,7 @@ public class JiraToDingding {
// DingdingUtils.sendToDingding(DingdingUtils.buildBugFixRemindMsg(issue), jiraBugPool.getDingUrl());
// 如果已超过4个小时,则发送钉钉通知
if
(
duration
>=
4
)
{
DingdingUtils
.
sendToDingding
(
DingdingUtils
.
buildBugFixRemindMsg
(
issue
),
"https://oapi.dingtalk.com/robot/send?access_token=835663338d638e40daaf3ab358af741ef0680a826a962c91bedc53b149d85ee1"
);
DingdingUtils
.
sendToDingding
(
DingdingUtils
.
buildBugFixRemindMsg
(
issue
,
duration
),
"https://oapi.dingtalk.com/robot/send?access_token=835663338d638e40daaf3ab358af741ef0680a826a962c91bedc53b149d85ee1"
);
}
}
}
...
...
src/main/java/cn/qg/holmes/utils/DingdingUtils.java
View file @
c5d0f680
...
...
@@ -110,7 +110,14 @@ public class DingdingUtils {
* @param issue Jira Issue
* @return
*/
public
static
String
buildBugFixRemindMsg
(
Issue
issue
)
{
public
static
String
buildBugFixRemindMsg
(
Issue
issue
,
Integer
elapsed
)
{
String
duration
=
""
;
if
(
elapsed
>=
4
&&
elapsed
<
8
)
{
duration
=
elapsed
.
toString
()
+
"小时"
;
}
if
(
elapsed
>=
8
)
{
duration
=
(
elapsed
/
8
)
+
"天"
;
}
Map
<
String
,
Object
>
markdown
=
new
HashMap
<>();
Map
<
String
,
String
>
contentMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
atMap
=
new
HashMap
<>();
...
...
@@ -118,11 +125,12 @@ public class DingdingUtils {
markdown
.
put
(
"at"
,
atMap
);
markdown
.
put
(
"msgtype"
,
"markdown"
);
contentMap
.
put
(
"title"
,
"BUG修复提醒"
);
String
content
=
"亲爱的"
+
issue
.
getAssignee
().
getDisplayName
()
+
"同学,你有一个BUG已经超过4个小时
未解决,请多注意哦!\n\n"
;
String
content
=
issue
.
getAssignee
().
getDisplayName
()
+
"同学,你有一个BUG已经超过"
+
duration
+
"
未解决,请多注意哦!\n\n"
;
String
bugUrl
=
"http://jira2.quantgroup.cn/browse/"
+
issue
.
getKey
();
content
+=
"BUG具体信息:\n\n"
;
content
+=
"- 标题:["
+
issue
.
getSummary
().
replace
(
"\""
,
""
)
+
"]("
+
bugUrl
+
")\n"
;
content
+=
"- 优先级:"
+
issue
.
getPriority
().
getName
()
+
"\n"
;
content
+=
"- 经办人:"
+
issue
.
getAssignee
().
getDisplayName
()
+
"\n\n"
;
contentMap
.
put
(
"text"
,
content
);
markdown
.
put
(
"markdown"
,
contentMap
);
return
JSON
.
toJSONString
(
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