Associating custom field values with queues in initialdata


#1

I’m using the following code as initialdata, each each custom field is a category of items for my shopping list. How do I associate these with my Shopping List queue? is this done in the @Final block, or can I do it in the @CustomFields data?

my $i = 1;
push @CustomFields, {
    LookupType  => 'RT::Queue-RT::Ticket',  # for Tickets
    Type        => 'SelectMultiple',
    Name        => 'COFFEE_AND_TEA',
    MaxValues   => 0,
    RenderType  => 'Select box',
    Values      => [
        { Name => 'coffee', Description => 'coffee', SortOrder => $i++ },
        { Name => 'creamer', Description => 'creamer', SortOrder => $i++ },
        { Name => 'tea', Description => 'tea', SortOrder => $i++ },
    ]
}, {
    LookupType  => 'RT::Queue-RT::Ticket',  # for Tickets
    Type        => 'SelectMultiple',
    Name        => 'EGGS_AND_DAIRY',
    MaxValues   => 0,
    RenderType  => 'Select box',
    Values      => [
        { Name => 'smoked_Gouda', Description => 'smoked Gouda', SortOrder => $i++ },
        { Name => 'lasagna_noodles', Description => 'lasagna noodles', SortOrder => $i++ },
        { Name => 'sliced_cheese', Description => 'sliced cheese', SortOrder => $i++ },
        { Name => 'milk', Description => 'milk', SortOrder => $i++ },
        { Name => 'cottage_cheese', Description => 'cottage cheese', SortOrder => $i++ },
        { Name => 'eggs', Description => 'eggs', SortOrder => $i++ },
        { Name => 'cheddar', Description => 'cheddar', SortOrder => $i++ },
        { Name => 'butter', Description => 'butter', SortOrder => $i++ },
        { Name => 'Monterey_jack', Description => 'Monterey jack', SortOrder => $i++ },
        { Name => 'cream_cheese', Description => 'cream cheese', SortOrder => $i++ },
        { Name => 'half_and_half', Description => 'half and half', SortOrder => $i++ },
        { Name => 'sour_cream', Description => 'sour cream', SortOrder => $i++ },
        { Name => 'yogurt_plain', Description => 'yogurt plain', SortOrder => $i++ },
        { Name => 'yogurts_little', Description => 'yogurts, little', SortOrder => $i++ },
    ]
};

#2

You can use “ApplyTo”:

     ApplyTo     => 'My QueueName',