summaryrefslogtreecommitdiff
path: root/app/services/issues/clone_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/issues/clone_service.rb')
-rw-r--r--app/services/issues/clone_service.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/services/issues/clone_service.rb b/app/services/issues/clone_service.rb
index 07dd9a98f89..8b05a1c2acd 100644
--- a/app/services/issues/clone_service.rb
+++ b/app/services/issues/clone_service.rb
@@ -75,7 +75,16 @@ module Issues
# Skip creation of system notes for existing attributes of the issue when cloning with notes.
# The system notes of the old issue are copied over so we don't want to end up with duplicate notes.
# When cloning without notes, we want to generate system notes for the attributes that were copied.
- CreateService.new(project: target_project, current_user: current_user, params: new_params, spam_params: spam_params).execute(skip_system_notes: with_notes)
+ create_result = CreateService.new(
+ project: target_project,
+ current_user: current_user,
+ params: new_params,
+ spam_params: spam_params
+ ).execute(skip_system_notes: with_notes)
+
+ raise CloneError, create_result.errors.join(', ') if create_result.error? && create_result[:issue].blank?
+
+ create_result[:issue]
end
def queue_copy_designs