diff --git a/models/issue.go b/models/issue.go index baf710a5ee..c370af363e 100644 --- a/models/issue.go +++ b/models/issue.go @@ -108,7 +108,17 @@ func NewIssue(issue *Issue) (err error) { sess.Rollback() return err } - return sess.Commit() + + if err = sess.Commit(); err != nil { + return err + } + + if issue.MilestoneId > 0 { + // FIXES(280): Update milestone counter. + return ChangeMilestoneAssign(0, issue.MilestoneId, issue) + } + + return } // GetIssueByIndex returns issue by given index in repository.