summaryrefslogtreecommitdiff
path: root/app/services/issues
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-22 15:09:48 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-22 15:09:48 +0000
commit640007842a876dfa551578feccfd0fe2307c522a (patch)
tree4204c45a13b9beac3040df00572ffe0ecdb0ca40 /app/services/issues
parent421f6c92d5984d035a7a6687d70277ba88f5f92b (diff)
downloadgitlab-ce-640007842a876dfa551578feccfd0fe2307c522a.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/issues')
-rw-r--r--app/services/issues/create_service.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/services/issues/create_service.rb b/app/services/issues/create_service.rb
index edf6d75b632..d4fbbf67420 100644
--- a/app/services/issues/create_service.rb
+++ b/app/services/issues/create_service.rb
@@ -13,6 +13,7 @@ module Issues
# in the caller (for example, an issue created via email) and the required arguments to the
# SpamParams constructor are not otherwise available, spam_params: must be explicitly passed as nil.
def initialize(project:, current_user: nil, params: {}, spam_params:, build_service: nil)
+ @extra_params = params.delete(:extra_params) || {}
super(project: project, current_user: current_user, params: params)
@spam_params = spam_params
@build_service = build_service || BuildService.new(project: project, current_user: current_user, params: params)
@@ -56,7 +57,7 @@ module Issues
handle_add_related_issue(issue)
resolve_discussions_with_issue(issue)
create_escalation_status(issue)
- try_to_associate_contact(issue)
+ try_to_associate_contacts(issue)
super
end
@@ -85,7 +86,7 @@ module Issues
private
- attr_reader :spam_params
+ attr_reader :spam_params, :extra_params
def create_escalation_status(issue)
::IncidentManagement::IssuableEscalationStatuses::CreateService.new(issue).execute if issue.supports_escalation?
@@ -101,11 +102,14 @@ module Issues
IssueLinks::CreateService.new(issue, issue.author, { target_issuable: @add_related_issue }).execute
end
- def try_to_associate_contact(issue)
+ def try_to_associate_contacts(issue)
return unless issue.external_author
return unless current_user.can?(:set_issue_crm_contacts, issue)
- set_crm_contacts(issue, [issue.external_author])
+ contacts = [issue.external_author]
+ contacts.concat extra_params[:cc] unless extra_params[:cc].nil?
+
+ set_crm_contacts(issue, contacts)
end
end
end