diff options
-rw-r--r-- | app/services/quick_actions/interpret_service.rb | 4 | ||||
-rw-r--r-- | doc/user/project/quick_actions.md | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb index 87937fef8f4..1a0e27d551a 100644 --- a/app/services/quick_actions/interpret_service.rb +++ b/app/services/quick_actions/interpret_service.rb @@ -270,7 +270,7 @@ module QuickActions desc 'Copy labels and milestone from other issue or merge request' explanation do |issuable_id| - "Copy labels and milestone from issue or merge_request \"#{issuable_id}\"." + "Copy labels and milestone from issue or merge_request #{issuable_id}." end params '#issue | !merge_request' condition do @@ -279,7 +279,7 @@ module QuickActions end command :copy_metadata do |issuable_id| source_issuable = extract_references(issuable_id, :issue).first - source_issuable = extract_references(issuable_id, :merge_request).first if !source_issuable.present? + source_issuable ||= extract_references(issuable_id, :merge_request).first if source_issuable.present? && source_issuable.project.id == issuable.project.id @updates[:add_label_ids] = source_issuable.labels.map(&:id) diff --git a/doc/user/project/quick_actions.md b/doc/user/project/quick_actions.md index 75799caacde..3e3b699edc4 100644 --- a/doc/user/project/quick_actions.md +++ b/doc/user/project/quick_actions.md @@ -41,4 +41,4 @@ do. | `/move path/to/project` | Moves issue to another project | | `/tableflip` | Append the comment with `(╯°□°)╯︵ ┻━┻` | | `/shrug` | Append the comment with `¯\_(ツ)_/¯` | -| <code>/copy_metadata < #issue | !merge_request ></code> | Copy labels and milestone from other issue or merge request | +| <code>/copy_metadata #issue | !merge_request </code> | Copy labels and milestone from other issue or merge request | |