Skip to content

Commit e34632b

Browse files
zjjhotzjj
and
zjj
authored
Add issue hyperlinks in the webhook of wechatwork (#18102)
Co-authored-by: zjj <[email protected]>
1 parent 31a2bf2 commit e34632b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

services/webhook/wechatwork.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (f *WechatworkPayload) Push(p *api.PushPayload) (api.Payloader, error) {
117117
func (f *WechatworkPayload) Issue(p *api.IssuePayload) (api.Payloader, error) {
118118
text, issueTitle, attachmentText, _ := getIssuesPayloadInfo(p, noneLinkFormatter, true)
119119
var content string
120-
content += fmt.Sprintf(" ><font color=\"info\">%s</font>\n >%s \n ><font color=\"warning\"> %s</font>", text, attachmentText, issueTitle)
120+
content += fmt.Sprintf(" ><font color=\"info\">%s</font>\n >%s \n ><font color=\"warning\"> %s</font> \n [%s](%s)", text, attachmentText, issueTitle, p.Issue.HTMLURL, p.Issue.HTMLURL)
121121

122122
return newWechatworkMarkdownPayload(content), nil
123123

@@ -127,7 +127,7 @@ func (f *WechatworkPayload) Issue(p *api.IssuePayload) (api.Payloader, error) {
127127
func (f *WechatworkPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error) {
128128
text, issueTitle, _ := getIssueCommentPayloadInfo(p, noneLinkFormatter, true)
129129
var content string
130-
content += fmt.Sprintf(" ><font color=\"info\">%s</font>\n >%s \n ><font color=\"warning\">%s</font>", text, p.Comment.Body, issueTitle)
130+
content += fmt.Sprintf(" ><font color=\"info\">%s</font>\n >%s \n ><font color=\"warning\">%s</font> \n [%s](%s)", text, p.Comment.Body, issueTitle, p.Comment.HTMLURL, p.Comment.HTMLURL)
131131

132132
return newWechatworkMarkdownPayload(content), nil
133133

0 commit comments

Comments
 (0)