Custom grid tabs

Custom grid tabs add a grid of entities to a module view or to an entity details view. Configure a tab as an external action to show entities related to the current context.

Overview

A custom grid tab displays one or more entity types in a grid. You can filter the grid using the selected entity or module context, add a query for further filtering, and set default values for entities created from the tab.

In this topic, a module view is the module page that displays an entity navigation tree. Selecting a tree node sets the context and filters the grid's contents.

For example, add a Requirements tab to the Quality module. When a user selects an application module, the tab can show requirement documents whose Application Module reference field points to that module.

To create a custom grid tab, add an entity_list JSON object in the external action editor. For details about the editor, see External actions.

Implementation examples

These examples show grid tabs in a module view or an entity details view. Set views to list for a module view grid or details for a details view grid. Include both values to show the tab in both views.

Application module requirements (module view grid)

The following example adds a Requirements tab to the Quality module. Replace app_module_udf with the REST field name of the Application Module reference field on your requirement documents.

Copy code
{
  "name": "quality-requirements-tab",
  "title": "Requirements",
  "views": ["list"],
  "entity_type": ["product_area"],
  "mode": {
    "name": "entity_list",
    "modules": ["quality"],
    "entity_type": ["requirement_document"],
    "display": "grid",
    "filter_by_context": {
      "app_module_udf": {"id": "context_entity"}
    },
    "default_values": {
      "app_module_udf": {"id": "context_entity"}
    }
  }
}

In this example, product_area is the application module entity type, and requirement_document is the entity type displayed in the grid. When a user selects an application module, context_entity filters requirement documents by app_module_udf. The same context token prefills the Application Module field when a user creates a requirement document from the tab.

Backlog item security defects (module view grid)

This example adds a Security Defects tab to the Backlog module. It shows defects whose parent is the selected context entity and whose detected-in release is the selected context release. The query further limits results to medium-priority, high-severity defects. The defaults carry the selected parent and release into the create defect dialog.

Copy code
{
    "name": "backlog-security-defects-tab",
    "title": "Security Defects",
    "views": ["list"],
    "entity_type": ["defect"],
    "mode": {
        "name": "entity_list",
        "modules": ["backlog"],
        "entity_type": ["defect"],
        "display": "grid",
        "filter_by_context": {
            "parent": {"id": "context_entity"},
            "detected_in_release": {"id": "context_release"}
        },
        "query": "priority={id='list_node.priority.medium'};severity={id='list_node.severity.high'}",
        "default_values": {
            "parent": {"id": "context_entity"},
            "detected_in_release": {"id": "context_release"}
        }
    }
}

In this example, parent filters defects to those whose parent is the selected context entity, and detected_in_release filters them to the selected release. The query limits results to medium-priority, high-severity defects. The default_values prefill Parent and Detected in Release when a user creates a defect from the tab.

Feature defects (details view grid)

This example adds a Defects tab to the details view of a Feature.

Copy code
{
    "name": "feature-defects-tab",
    "title": "Defects",
    "views": ["details"],
    "entity_type": ["feature"],
    "mode": {
        "name": "entity_list",
        "entity_type": ["defect"],
        "display": "grid",
        "filter_by_context": {
            "parent": {"id": "context_entity"}
        }
    }
}

In this example, the top-level entity_type makes the tab available on Features, while mode.entity_type selects Defects for the grid. The parent context filter limits the grid to defects whose parent is the Feature whose details are open.

JSON property reference

Property Purpose Notes
name Unique action name. Required. Internal action identifier used to generate the tab's internal name.
title Text displayed on the tab. Required.
views Specifies where the tab appears.

Required. Choose one or both the following placements:

  • list: Shows the tab in a module view. Set mode.modules to the module ID.

  • details: Shows the tab in an entity details view. Set the top-level entity_type to the host entity type.

entity_type Host entity types for details placement and the fallback entity type for grid rows.

Required in every action.

  • When views includes details, identifies which entity types can display the tab. 

  • When views includes list, supplies the grid entity type only when mode.entity_type is omitted. mode.modules is used to determine the module placement.

mode.name Set to entity_list. Required.
mode.modules Module views where the tab appears. Set this when views includes list; without it, the tab does not appear in a module view. Omit it for details-only tabs. Use one of these case-sensitive module IDs: quality, backlog, requirements, or model_based_testing.
mode.entity_type Entity types displayed in the grid.

Use REST entity names, such as requirement_document or defect. When set, this takes precedence over the top-level entity_type for grid rows.

To display multiple types in one grid, specify subtypes of the same aggregate root. For example, ["defect", "story"] displays work items, and ["test_manual", "gherkin_test"] displays manual and Gherkin tests. Types from different aggregate roots cannot be combined.

For the complete catalog of entity types and subtype relationships, see Entity metadata reference.

mode.display Display mode. If specified, the only supported value is grid.
mode.filter_by_context Filters target entities by context.

Map each target entity field to an object with an id. The field must exist on the target entity type.

The id can be:

  • context_entity: The selected entity. For a hierarchical reference field that supports descendants, you can include descendant entities.

  • context_release, context_sprint, context_milestone, context_team, or context_program: Values selected in the corresponding context filter. If no values are selected, no condition is added.

  • any, empty, or all: Match a non-empty field, match a null field, or add no condition, respectively.

  • A list logical name, such as list_node.severity.high, matches that list value.

  • A literal value. For example, {"name":{"id":"Login"}} matches entities whose name is exactly Login.

mode.query Adds a fixed query condition to the grid's fetched results.

The query limits which entities appear in the grid. It is applied in addition to context and user-applied grid filters.

For example, priority={id='list_node.priority.medium'};severity={id='list_node.severity.high'} shows entities with medium priority and high severity.

For query syntax, see Retrieve and filter collections.

mode.default_values Sets initial field values in the create entity dialog. Map target field names to text, numbers, true/false values, reference objects, or arrays of reference objects. Context references use the same id format as filter_by_context.
mode.tab_index Sets the tab's position. Use a positive, one-based index. If omitted, the tab appears after the existing tabs.

Note: Field names in filter_by_context, query, and default_values must match fields on the target entity type. Reference fields and values must also be valid for that entity.