Feature #22913 » auto_select_fields.patch
| app/controllers/imports_controller.rb | ||
|---|---|---|
|
@attributes = issue.safe_attribute_names
|
||
|
@custom_fields = issue.editable_custom_field_values.map(&:custom_field)
|
||
|
if @import.mapping.empty?
|
||
|
@import.settings['mapping'] = {}
|
||
|
# Core issue fields
|
||
|
%w(subject description priority category assigned_to fixed_version is_private parent_issue_id start_date due_date estimated_hours done_ratio).each do |field|
|
||
|
label = l("field_#{field.gsub(/\_id$/, '')}".to_sym)
|
||
|
@import.mapping[field] = @import.headers.index(label)
|
||
|
end
|
||
|
# Custom fields
|
||
|
issue.available_custom_fields.each do |field|
|
||
|
@import.mapping["cf_#{field.id}"] = @import.headers.index(field.name)
|
||
|
end
|
||
|
end
|
||
|
if request.post?
|
||
|
respond_to do |format|
|
||
|
format.html {
|
||
| ... | ... | |
|
def max_items_per_request
|
||
|
5
|
||
|
end
|
||
|
end
|
||