From 477b4de0d14ac5f262b16b81804febcb6eb0e0b7 Mon Sep 17 00:00:00 2001 From: Lanre Adelowo Date: Mon, 4 Feb 2019 09:33:56 +0100 Subject: [PATCH] handle milestone events for issues and PR (#5947) (#5955) Backport of #5947 --- models/webhook_slack.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/models/webhook_slack.go b/models/webhook_slack.go index 3a21f9860..5c67951fb 100644 --- a/models/webhook_slack.go +++ b/models/webhook_slack.go @@ -160,6 +160,10 @@ func getSlackIssuesPayload(p *api.IssuePayload, slack *SlackMeta) (*SlackPayload text = fmt.Sprintf("[%s] Issue labels cleared: %s by %s", p.Repository.FullName, titleLink, senderLink) case api.HookIssueSynchronized: text = fmt.Sprintf("[%s] Issue synchronized: %s by %s", p.Repository.FullName, titleLink, senderLink) + case api.HookIssueMilestoned: + text = fmt.Sprintf("[%s] Issue milestoned: #%s %s", p.Repository.FullName, titleLink, senderLink) + case api.HookIssueDemilestoned: + text = fmt.Sprintf("[%s] Issue milestone cleared: #%s %s", p.Repository.FullName, titleLink, senderLink) } return &SlackPayload{ @@ -312,6 +316,10 @@ func getSlackPullRequestPayload(p *api.PullRequestPayload, slack *SlackMeta) (*S text = fmt.Sprintf("[%s] Pull request labels cleared: %s by %s", p.Repository.FullName, titleLink, senderLink) case api.HookIssueSynchronized: text = fmt.Sprintf("[%s] Pull request synchronized: %s by %s", p.Repository.FullName, titleLink, senderLink) + case api.HookIssueMilestoned: + text = fmt.Sprintf("[%s] Pull request milestoned: #%s %s", p.Repository.FullName, titleLink, senderLink) + case api.HookIssueDemilestoned: + text = fmt.Sprintf("[%s] Pull request milestone cleared: #%s %s", p.Repository.FullName, titleLink, senderLink) } return &SlackPayload{