Commit 1fc42935 authored by Robert Speicher's avatar Robert Speicher

Bring CE-EE parity to app/services/boards/issues/create_service.rb

parent 87aef527
module Boards
module Issues
class CreateService < Boards::BaseService
prepend ::EE::Boards::Issues::CreateService
attr_accessor :project
def initialize(parent, project, user, params = {})
......@@ -10,23 +12,13 @@ module Boards
end
def execute
create_issue(creation_params)
create_issue(params.merge(issue_params))
end
private
def creation_params
params.merge(label_ids: [list.label_id, *board.label_ids],
weight: board.weight,
milestone_id: board.milestone_id,
assignee_ids: assignee_ids)
end
# This can be safely removed when the board
# receive multiple assignee support.
# See: https://gitlab.com/gitlab-org/gitlab-ee/issues/3786
def assignee_ids
@assigne_ids ||= Array(board.assignee&.id)
def issue_params
{ label_ids: [list.label_id] }
end
def board
......
module EE
module Boards
module Issues
module CreateService
extend ::Gitlab::Utils::Override
override :issue_params
def issue_params
{
label_ids: [list.label_id, *board.label_ids],
weight: board.weight,
milestone_id: board.milestone_id,
# This can be removed when boards have multiple assignee support.
# See https://gitlab.com/gitlab-org/gitlab-ee/issues/3786
assignee_ids: Array(board.assignee&.id)
}
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment