<&| /Admin/Queues/Elements/SortableBox, prefix => $prefix, is_filter => 1, class_name => 'MemberOfRole' &>
<p><&|/l&>This filter selects eligible owners by their role membership. Only members of the following role, either on the queue or on the ticket itself, will be automatically assigned tickets.</&></p>

  <&| /Elements/LabeledValue, Label => loc('Role') &>
    <select id="<% $prefix %>_role" name="<% $prefix %>_role" class="selectpicker form-select">
      <option value="">-</option>
%   for my $role (qw/AdminCc Cc Requestor/) {
      <option <% ($config->{role}||'') eq $role ? "selected" : "" %> value="<% $role %>"><% $role %></option>
%   }
% if ($custom_roles) {
%   while (my $role = $custom_roles->Next) {
      <option <% ($config->{role}||0) eq $role->Id ? "selected" : "" %> value="<% $role->Id %>"><% $role->Name %></option>
%   }
% }
    </select>
  </&>
</&>

<%INIT>
my $custom_roles;
$custom_roles = RT::CustomRoles->new($session{CurrentUser});
$custom_roles->LimitToObjectId($queue->Id);
$custom_roles->ApplySortOrder;
</%INIT>
<%ARGS>
$prefix
$config
$queue
</%ARGS>
