aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go
index f1a092debd..ffbc110a6b 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -1100,6 +1100,7 @@ type IssuesOptions struct {
LabelIDs []int64
IncludedLabelNames []string
ExcludedLabelNames []string
+ IncludeMilestones []string
SortType string
IssueIDs []int64
UpdatedAfterUnix int64
@@ -1241,6 +1242,13 @@ func (opts *IssuesOptions) setupSession(sess *xorm.Session) {
if len(opts.ExcludedLabelNames) > 0 {
sess.And(builder.NotIn("issue.id", BuildLabelNamesIssueIDsCondition(opts.ExcludedLabelNames)))
}
+
+ if len(opts.IncludeMilestones) > 0 {
+ sess.In("issue.milestone_id",
+ builder.Select("id").
+ From("milestone").
+ Where(builder.In("name", opts.IncludeMilestones)))
+ }
}
func applyReposCondition(sess *xorm.Session, repoIDs []int64) *xorm.Session {