Skip to content

Preset

Preset is a data structure that's contains the layout and filters on the Incidents page.

Presets contain the following fields:

Field Type Description
id String ID of the preset.
name String Name of the preset.
key String Preset key. Used to filter presets. See the Preset Data section for a list of pre-defined keys.
data Object Preset data. See the Preset Data for more information.

Preset Data

Preset data depends on the key. SAYMON has 3 pre-defined keys that are used for the Incidents page presets:

You aren't limited to this set of keys. You can set custom key and data fields if you need to use presets for your own purpose:

{
    "name": "Custom Preset",
    "key": "custom-preset-key",
    "data": {
        "var1": "string",
        "var2": 2,
    },
    "id": "63217ff796c41c1259c1bd3a"
}

Incident table layout

Incidents page uses presets with the key incident-page-preset-picker to define the layout of the incidents table. The data field contains the list of columns, their order in the UI, and how to sort them. This key is used for both incident history and a list of active incidents.

Field Type Description
sortData Object Sorting settings.
visibleHeaderIds Array Array of header states.
columnOrder Array<String> Array of column names that determines the order in which they're shown in the table

sortData is an object that stores the sorting settings. It contains the following variables:

Field Type Description
column String Name of the column to sort the table by.
direction String Sort direction. Possible values — asc and desc.

visibleHeaderIds is an array of header states. Consists of a header name (an Incident variable) followed by a Boolean value of whether to show this column.

Headers shown by default:

  • registeredTime
  • occurredTime
  • clearedTime
  • entity
  • severity
  • text
  • comment
  • acknowledgedBy

Preset example:

{
    "name": "...",
    "id": "...",
    "key": "incident-page-preset-picker",
    "data": {
        "sortData": {
            "column": "entity",
            "direction": "asc"
        },
        "visibleHeaderIds": [
            [
                "severity",
                false
            ],
            [
                "occurredTime",
                false
            ],
            [
                "clearedTime",
                false
            ],
            [
                "registeredTime",
                false
            ]
        ],
        "columnOrder": [
            "clearedTime",
            "entity",
            "registeredTime",
            "text",
            "acknowledgedBy",
            "comment",
            "data.mediaUrl"
        ]
    }
}

Incident page filters

You can create filters for the Incidents page. Tags for the incident history and active incidents are different — incident-page-filter-filter-preset-picker and incident-history-filter-panel-filter-preset-picker respectively.

Preset data for the page filters includes the following fields:

Field Type Description
filter Incident Filter Incident filters. See the Filters section for more information.
defaultViewPreset String The name of the incidents table layout preset that's used with the filter preset.