summaryrefslogtreecommitdiffstats
path: root/services/issue
diff options
context:
space:
mode:
Diffstat (limited to 'services/issue')
-rw-r--r--services/issue/milestone.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/services/issue/milestone.go b/services/issue/milestone.go
new file mode 100644
index 0000000000..6fe527f58c
--- /dev/null
+++ b/services/issue/milestone.go
@@ -0,0 +1,21 @@
+// Copyright 2019 The Gitea Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package issue
+
+import (
+ "code.gitea.io/gitea/models"
+ "code.gitea.io/gitea/modules/notification"
+)
+
+// ChangeMilestoneAssign changes assignment of milestone for issue.
+func ChangeMilestoneAssign(issue *models.Issue, doer *models.User, oldMilestoneID int64) (err error) {
+ if err = models.ChangeMilestoneAssign(issue, doer, oldMilestoneID); err != nil {
+ return
+ }
+
+ notification.NotifyIssueChangeMilestone(doer, issue, oldMilestoneID)
+
+ return nil
+}