I am trying to set 2 system configuration fields through installing an opm package.
The fields are:
Ticket::Type,
which is a checkbox and I want it to be enabled
and:
Ticket::Frontend::CustomerTicketMessage###DynamicField
which is an array of dynamic fields displayed in the customer front end, and I need to add an entry like this:
Severity <-> 1 - Enabled
I am using the <CodeInstall Type="post"> tag like this:
Code: Select all
<CodeInstall Type="post">
        <![CDATA[
            $Kernel::OM->Get('Kernel::System::DB')->Do(SQL => "INSERT INTO dynamic_field (internal_field, name, label, field_order, field_type, object_type, config, valid_id, create_by, create_time, change_by, change_time) VALUES (0, \"Severity\", \"Severity\", 11, \"Dropdown\", \"Ticket\", \"--- \nDefaultValue: 4 informational \nLink: '' \nLinkPreview: '' \nPossibleNone: '0' \nPossibleValues: \n  1 emergency: 1 emergency \n  2 critical: 2 critical  \n  3 warning: 3 warning  \n  4 informational: 4 informational \nTranslatableValues: '0'\nTreeView: '0' \n\", 1, 1, current_timestamp, 1, current_timestamp); 
            ");
        ]]>
         <![CDATA[
            $Kernel::OM->Get('Kernel::System::DB')->Do(SQL => "INSERT INTO ticket_type ( name, valid_id, create_by, create_time, change_by, change_time) VALUES ( \"RfC / FYI\", 1, 1, current_timestamp, 1, current_timestamp); 
            ");
        ]]>
         <![CDATA[
            $Kernel::OM->Get('Kernel::System::DB')->Do(SQL => "INSERT INTO ticket_type ( name, valid_id, create_by, create_time, change_by, change_time) VALUES (\"Incident\", 1, 1, current_timestamp, 1, current_timestamp); 
            ");
        ]]>
         <![CDATA[
            $Kernel::OM->Get('Kernel::System::DB')->Do(SQL => "INSERT INTO ticket_type ( name, valid_id, create_by, create_time, change_by, change_time) VALUES (\"Change Request\", 1, 1, current_timestamp, 1, current_timestamp); 
            ");
        ]]>
        
        <![CDATA[
                $Kernel::OM->Get('Kernel::System::SysConfig')->SettingUpdate(
                Valid => 1,
                UserID       => 1,  
                Key => 'Ticket::Frontend::CustomerTicketMessage###DynamicField',
                EffectiveValue => {
                    DefaultColumns => {
                    Severity => "1"
                    }
                }
                );
            $Kernel::OM->Get('Kernel::System::SysConfig')->SettingUpdate(
                Name                  => 'Ticket::Type',
                EffectiveValue        => 1,  
                UserID                => 1,
            );
        ]]>
	</CodeInstall>I couldn't find what the exact syntax of these settings should be when using the Perl API.
Thank you,
George