Hide/Show Dynamic Fields

A dynamic field enables the extension of the information stored in a ticket and the individual configuration of your OTRS. However, dynamic fields can also cause confusion when they appear in the wrong context.

With this feature you can build flexible and dynamic forms by hiding or showing fields based on ticket information, permissions and more. This is controlled by ticket Access Control Lists (ACL).

A typical example of an internal IT department process is the ordering of hardware or software in OTRS. Dynamic fields help structure this order process through drop-down lists. For example, after choosing the hardware to be ordered, the feature ensures that only appropriate choices will appear in the next step, e.g. screen, keyboard and printer. The dynamic fields defined for software, like word processing, image processing or spreadsheet software, will not be displayed.

The hide/show dynamic fields function can be used in agent and external interface. The following screens can be configured.

Agent interface:

  • New Email Ticket

  • New Phone Ticket

  • New Process Ticket (incl. Process Activity Dialogs)

  • New SMS Ticket

  • Close Ticket

  • Change Customer

  • Send Email Outbound

  • Change Free Fields

  • Link Objects

  • Merge Ticket

  • Move Ticket

  • Add Note

  • Change Owner

  • Set Pending Time

  • Add Phone Call Inbound

  • Add Phone Call Outbound

  • Change Priority

  • Change Responsible

  • Send SMS Outbound

  • Forward via Email

  • Redirect via Email

  • Reply via Email

  • Reply to All via Email

  • Reply via Note

  • Reply via SMS

External interface:

  • Create New Ticket

  • Create New Process Ticket (incl. Process Activity Dialogs)

  • Ticket Reply (within Ticket Detail View)

Note

This feature works with ticket dynamic fields only. Other dynamic field object types are not supported.

The following example shows how to use this feature when dynamic fields should be displayed based on specific rules.

Goals:

  • If brand VW is selected, all dynamic fields should be hidden and just VW Model is displayed.

  • If VW model Up is selected, all dynamic fields should be displayed except for the fields Peugeot Model and Peugeot Production Facility.

Create the following dynamic fields:

Object

Type

Name

Label

Possible values

Ticket

Dropdown

Brand

Brand

  • VW → VW

  • Peugeot → Peugeot

Ticket

Dropdown

VWModel

VW Model

  • Up → Up

  • Polo → Polo

  • Golf → Golf

  • T5 → T5

Ticket

Dropdown

VWProductionFacility

VW Production Facility

  • Barcelona → Barcelona

  • Berlin → Berlin

  • Bratislava → Bratislava

Ticket

Dropdown

PeugeotModel

Peugeot Model

  • 207 → 207

  • 307 → 307

Ticket

Dropdown

PeugeotProductionFacility

Peugeot Production Facility

  • Poissy → Poissy

  • Madrid → Madrid

  • Trnava → Trnava

Ticket

Dropdown

Fuel

Fuel

  • Gasoline → Gasoline

  • Diesel → Diesel

  • Gas → Gas

Ticket

Multiselect

Accessories

Accessories

  • CDRadio → CD Radio

  • GPS → GPS

  • ProximitySensors → Proximity Sensors

  • RearCamera → Rear Camera

  • ClimateControl → Climate Control

Ticket

Textarea

Remarks

Remarks

Ticket

Date

RegistrationDate

Registration Date

Ticket

Date

InvoiceDate

Invoice Date

Note

All Dropdown and Multiselect dynamic fields should have the option Add empty value set to Yes in their configuration.

Add the dynamic fields to the New Phone Ticket screen via setting Forms###AgentFrontend::TicketCreate::Phone::CreateProperties:

- Label: Dynamic Fields
  Collapsible: 1
  Fields:
  - Name: DynamicField_Brand
  - Name: DynamicField_VWModel
  - Name: DynamicField_VWProductionFacility
  - Name: DynamicField_PeugeotModel
  - Name: DynamicField_PeugeotProductionFacility
  - Name: DynamicField_Fuel
  - Name: DynamicField_Accessories
  - Name: DynamicField_Remarks
  - Name: DynamicField_RegistrationDate
  - Name: DynamicField_InvoiceDate

Import this ACL:

---
- ChangeBy: root@localhost
  ChangeTime: 2019-07-22 11:44:25
  Comment: ''
  ConfigChange:
    PossibleNot:
      Form:
      - PeugeotModel
      - PeugeotProductionFacility
      - Accessories
      - Fuel
      - Remarks
      - RegistrationDate
      - InvoiceDate
  ConfigMatch:
    Properties:
      Ticket:
        DynamicField_Brand:
        - VW
  CreateBy: root@localhost
  CreateTime: 2019-07-22 11:40:43
  Description: ''
  ID: 1
  Name: ACL-VW
  StopAfterMatch: 0
  ValidID: 1

Detailed explanation:

DynamicField_Brand:
- VW

The condition for this ACL rule. If brand VW is selected, the rule will come into action. The array contains the used possible values. These are keys found in your database inside the dynamic_field table in column config. In this example it is a dynamic field of type Dropdown.

PossibleNot:
  Form:
  - PeugeotModel
  - PeugeotProductionFacility
  - Accessories
  - Fuel
  - Remarks
  - RegistrationDate
  - InvoiceDate

This section lists the dynamic fields that should not be visible. In this example the dynamic fields VW Model and VW Production Facility are visible. All other dynamic fields will be hidden.

Import this second ACL:

---
- ChangeBy: root@localhost
  ChangeTime: 2019-07-22 12:06:24
  Comment: ''
  ConfigChange:
    Possible:
      Ticket:
        DynamicField_Accessories:
        - CDRadio
        - ClimateControl
        DynamicField_Fuel:
        - Gasoline
        DynamicField_VWProductionFacility:
        - Bratislava
    PossibleAdd:
      Form:
      - Accessories
      - Fuel
      - Remarks
      - RegistrationDate
      - InvoiceDate
    PossibleNot:
      Form:
      - PeugeotModel
      - PeugeotProductionFacility
  ConfigMatch:
    Properties:
      Ticket:
        DynamicField_Brand:
        - VW
        DynamicField_VWModel:
        - Up
  CreateBy: root@localhost
  CreateTime: 2019-07-22 11:47:02
  Description: ''
  ID: 2
  Name: ACL-VW-Up
  StopAfterMatch: 0
  ValidID: 1

Detailed explanation:

DynamicField_Brand:
- VW
DynamicField_VWModel:
- Up

In this example two conditions should be met. Brand has to be VW and VW model has to be Up for this rule to come into action. It will be triggered only if an agent selects brand VW and VW model Up.

PossibleAdd:
  Form:
  - Accessories
  - Fuel
  - Remarks
  - RegistrationDate
  - InvoiceDate

Here the dynamic fields VW Model and VW Production Facility were already visible and they remain, but Accessories, Fuel, Remarks, Registration Date and Invoice Date has to be re-added to the fields that are visible. This is done in the PossibleAdd section as the first ACL sets this fields as not shown and both ACLs works together. If this was done in the Possible section for example, the result will be that only these fields explicitly will be shown and VW Model and VW Production Facility will be hidden as they are not longer part of the (new) Possible section.

PossibleNot:
  Form:
  - PeugeotModel
  - PeugeotProductionFacility

Just Peugeot Model and Peugeot Production Facility are invisible (in our example it does not make much sense to configure a Peugeot model if the user has a VW Up).

In addition to the visibility of dynamic fields there is the possibility to show just some of the possible values of a dynamic field. Combined into ACL rules like in here, makes it easier to handle big multiselects.

Possible:
  Ticket:
    DynamicField_Accessories:
    - CDRadio
    - ClimateControl
    DynamicField_Fuel:
    - Gasoline
    DynamicField_VWProductionFacility:
    - Bratislava

In our example a VW Up can have just CD Radio and Climate Control as extra accessories, just Gasoline as fuel and can be produced just in Bratislava.

If we would have an ACL rule for Peugeot 207 for example, there may be other extras, fuel options and production locations selectable.

Note

If you are showing dynamic fields using the Possible option based on a DynamicField_NameX value, is normally desirable to include the dynamic field that triggers the ACL to be part of the fields to be displayed in the Possible or PossibleAdd sections (if apply). Otherwise if Possible or PossibleAdd contains other fields and not the trigger, the latest will not be shown after the value is selected.

Note

The mandatory status of the fields can not be changed using this method.

Scroll to Top