I recommend to use TicketAcl. Example is attached.

package Kernel::Config::Files::ZZZTicketAclDynamicFieldLocationDependency;
use utf8;

# ---------------------------------------------------- #
# Build Location default selection
# ---------------------------------------------------- #
$Self->{TicketAcl}->{'100-100-100 - Build Location* default selection'} = {
    Properties => {
        # match always
    },
    Possible => {
        Ticket => {
#            DynamicField_LocationCity => ['[RegExp].*'],
            DynamicField_LocationBuilding => [''],
            DynamicField_LocationLevel => [''],
            DynamicField_LocationRoom => [''],
        },
    },
};   

# ---------------------------------------------------- #
# Build Location Building selection
# ---------------------------------------------------- #

# London
$Self->{TicketAcl}->{'200-101-101 - Build LocationBuilding selection for LocationCity value'} = {
    Properties => {
        Ticket => {
            DynamicField_LocationCity => ['London'],
        },
    },
    Possible => {        
        Ticket => {
            DynamicField_LocationBuilding => ['', '[RegExp]London'],
        },
    },
};

# Berlin
$Self->{TicketAcl}->{'200-101-102 - Build LocationBuilding selection for LocationCity value'} = {
    Properties => {
        Ticket => {
            DynamicField_LocationCity => ['Berlin'],
        },
    },
    Possible => {        
        Ticket => {
            DynamicField_LocationBuilding => ['', '[RegExp]Berlin'],
        },
    },
};

# ---------------------------------------------------- #
# Build Location Level selection
# ---------------------------------------------------- #

# London
$Self->{TicketAcl}->{'200-102-101 - Build LocationLevel selection for LocationBuilding value'} = {
    Properties => {
        Ticket => {
            DynamicField_LocationCity => ['London'],
            DynamicField_LocationBuilding => ['London-A'],
        },
    },
    Possible => {        
        Ticket => {
            DynamicField_LocationLevel => ['', '[RegExp]London-A'],
        },
    },
};   

# Berlin
$Self->{TicketAcl}->{'200-102-102 - Build LocationLevel selection for LocationBuilding value'} = {
    Properties => {
        Ticket => {
            DynamicField_LocationCity => ['Berlin'],
            DynamicField_LocationBuilding => ['Berlin-A'],
        },
    },
    Possible => {        
        Ticket => {
            DynamicField_LocationLevel => ['', '[RegExp]Berlin-A'],
        },
    },
};   
      
# ---------------------------------------------------- #
# Build Location Room selection
# ---------------------------------------------------- #

# London
$Self->{TicketAcl}->{'200-103-101 - Build LocationRoom selection for LocationLevel value'} = {
    Properties => {
        Ticket => {
            DynamicField_LocationCity => ['London'],
            DynamicField_LocationBuilding => ['London-A'],
            DynamicField_LocationLevel => ['London-A-1'],
        },
    },
    Possible => {        
        Ticket => {
            DynamicField_LocationRoom => ['', '[RegExp]London-A-1'],
        },
    },
};   

# Berlin
$Self->{TicketAcl}->{'200-103-102 - Build LocationRoom selection for LocationLevel value'} = {
    Properties => {
        Ticket => {
            DynamicField_LocationCity => ['Berlin'],
            DynamicField_LocationBuilding => ['Berlin-A'],
            DynamicField_LocationLevel => ['Berlin-A-1'],
        },
    },
    Possible => {        
        Ticket => {
            DynamicField_LocationRoom => ['', '[RegExp]Berlin-A-1'],
        },
    },
};   

# ---------------------------------------------------- #
# EOF
# ---------------------------------------------------- #
1;

On 12.03.2013, at 00:34, Marty Hillman wrote:

I am looking to utilize two dynamic fields for ticket entry where the dropdown in field 2 is dependent upon the entry in field 1.  For example, in field 1 the user can select Problem or Request.  If they select Problem, field 2 gives them a choice of email, printing phone, etc.  If they select Request, they are offered website, login or other.
 
I actually need to extend this a bit further with a primary field, but if someone can tell me how to create field 2 properly,  I can work out the logic for the overly complicated scenario.
 
I have been reading the documentation cover to cover but have not been able to figure out how to do this.  Anyone have any ideas or suggestions for better initial setup documentation?

Cheers, Nils
-- 
http://webint.cryptonode.de / a Fractal project

---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

Reply via email to