diff options
author | Stan Hu <stanhu@gmail.com> | 2017-08-03 02:58:28 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-08-03 02:58:28 +0300 |
commit | 408df2edcbd5f3f93ef5541bac9de2b71ba4f0ea (patch) | |
tree | 708ae61f9683b48f436f7577d1fad98f30e100fc /app/services/issues/move_service.rb | |
parent | 3f81586ef0ab20533b8da1213bd9f60e1786dbaa (diff) | |
parent | faa2a123911eaf84bb57163ea7af759d4632601b (diff) |
Merge branch 'master' into sh-headless-chrome-support
Diffstat (limited to 'app/services/issues/move_service.rb')
-rw-r--r-- | app/services/issues/move_service.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/services/issues/move_service.rb b/app/services/issues/move_service.rb index 711f4035c55..29def25719d 100644 --- a/app/services/issues/move_service.rb +++ b/app/services/issues/move_service.rb @@ -61,8 +61,18 @@ module Issues end def cloneable_milestone_id - @new_project.milestones - .find_by(title: @old_issue.milestone.try(:title)).try(:id) + title = @old_issue.milestone&.title + return unless title + + if @new_project.group && can?(current_user, :read_group, @new_project.group) + group_id = @new_project.group.id + end + + params = + { title: title, project_ids: @new_project.id, group_ids: group_id } + + milestones = MilestonesFinder.new(params).execute + milestones.first&.id end def rewrite_notes |