Commit da15007f authored by Mateusz Bajorski's avatar Mateusz Bajorski

Fixed inconsistent descriptions and refactored reference checking

parent 427bfae2
......@@ -258,7 +258,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
......@@ -267,7 +267,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)
......
......@@ -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 &lt; #issue &#124; !merge_request &gt;</code> | Copy labels and milestone from other issue or merge request |
| <code>/copy_metadata #issue &#124; !merge_request </code> | Copy labels and milestone from other issue or merge request |
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