diff --git a/app/assets/javascripts/app/controllers/_ui_element/ticket_selector.coffee b/app/assets/javascripts/app/controllers/_ui_element/ticket_selector.coffee index 50b637484..e69c5fd89 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/ticket_selector.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/ticket_selector.coffee @@ -87,6 +87,9 @@ class App.UiElement.ticket_selector config.operator = operator elements["#{groupKey}.#{config.name}"] = config + if config.tag == 'select' + config.multiple = true + if attribute.out_of_office elements['ticket.out_of_office_replacement_id'] = name: 'out_of_office_replacement_id' diff --git a/spec/system/admin/trigger/custom_attribute_as_multiselect_spec.rb b/spec/system/admin/trigger/custom_attribute_as_multiselect_spec.rb new file mode 100644 index 000000000..b462da03d --- /dev/null +++ b/spec/system/admin/trigger/custom_attribute_as_multiselect_spec.rb @@ -0,0 +1,29 @@ +require 'rails_helper' + +RSpec.describe 'Admin Panel > Trigger', type: :system do + it 'custom select attribute allows to select multiple values', db_strategy: :reset do + attribute = create_attribute :object_manager_attribute_select, + data_option: { + options: { + 'name 1': 'name 1', + 'name 2': 'name 2', + }, + default: '', + null: false, + relation: '', + maxlength: 255, + nulloption: true, + } + + visit '/#manage/trigger' + click '.page-header-meta .btn--success' + + modal_ready + + within '.modal .ticket_selector' do + find('.js-attributeSelector select').select(attribute.display) + + expect(find('.js-value select')).to be_multiple + end + end +end