I created one and tried to use it on my tickets and it errors out when creating a ticket. I get a dark box with a red X stating Invalid Valaue ‘[“2”,“3”,“4”]’ for field test1 (see below)
I managed to solve this problem by editing the source code. Below are the steps I took.
Open /opt/zammad/lib/excel_sheet.rb
Remove the following if statement from value_lookup:
if value.is_a?(Array)
value = value.join(',')
end
Replace the first when block in value_convert with this when block:
when 'boolean', %r{^(multi|tree_)?select$}
if object[:data_option].present? && object[:data_option]['options'].present?
if value.is_a?(Array)
displays = []
value.each do |key|
displays.push(ObjectManager::Attribute.data_options_hash(object[:data_option]['options'])[key])
end
value = displays.join(',')
else
value = ObjectManager::Attribute.data_options_hash(object[:data_option]['options'])[value]
end
end
@worksheet.write_string(@current_row, @current_column, value) if value.present?
Restart zammad:
systemctl restart zammad
Zammad creates an array of Keys. Then it turns that array into a comma-separated string of keys (step 2 prevents this). Then it tries to get the Display value of that comma-separated string of Keys. It should try to get the Display value of each Key individually.
The code in step 3 retrieves the Display value of each Key, then joins those values into a comma-separated string.