From f6d75f091733aa94dcfe011c374d885be4ad6c11 Mon Sep 17 00:00:00 2001 From: haseeb Date: Thu, 10 Aug 2017 20:38:24 +0530 Subject: copy milestones from issue when using create merge request btn --- app/controllers/projects/issues_controller.rb | 2 +- app/services/merge_requests/create_from_issue_service.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index f4d4cca8dd8..8893a514207 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -212,7 +212,7 @@ class Projects::IssuesController < Projects::ApplicationController end def create_merge_request - result = MergeRequests::CreateFromIssueService.new(project, current_user, issue_iid: issue.iid).execute + result = ::MergeRequests::CreateFromIssueService.new(project, current_user, issue_iid: issue.iid).execute if result[:status] == :success render json: MergeRequestCreateSerializer.new.represent(result[:merge_request]) diff --git a/app/services/merge_requests/create_from_issue_service.rb b/app/services/merge_requests/create_from_issue_service.rb index 738cedbaed7..aec68c74aa6 100644 --- a/app/services/merge_requests/create_from_issue_service.rb +++ b/app/services/merge_requests/create_from_issue_service.rb @@ -43,7 +43,9 @@ module MergeRequests { source_project_id: project.id, source_branch: branch_name, - target_project_id: project.id + target_project_id: project.id, + labels: issue.labels, + milestone_id: issue.milestone_id } end -- cgit v1.2.1