# Grouping objects

> Group requirements, test cases, or test sets by custom label fields to view them in a structured, sprint- or component-based layout.

You can group your objects by custom field definitions of the type **Label**.

:::important
The **Group by** capability (which is part of custom structured views) is available in Test Manager only when delivered through Test Cloud.
:::

## Scenario

Consider the following scenario. You want to check the test cases which were run in a particular sprint, on a specific application component. You also want to check the sprint and the component for test “GUJDM:15”. You navigate to the **Test Cases** view, but it is difficult to obtain this information from the **Test Cases** list.

The flow has the following steps:

1. Create the following custom field definitions and their values. A custom field definition is a multi-select field.
   * Test Cycle

Figure 1. Test Cycle custom field

   ![Test Cycle custom field](https://dev-assets.cms.uipath.com/assets/images/test-manager/test-manager-test-cycle-custom-field-647194-bf7f38ac-cdfff828.webp)
   * Product Component

Figure 2. Product Component custom field

   ![Product Component custom field](https://dev-assets.cms.uipath.com/assets/images/test-manager/test-manager-product-component-custom-field-647198-dc3f05a6-42dd99a0.webp)
2. Go to **Test Cases**.
3. Select **Group by**, and select "Test Cycle".

Figure 3. Group by Test Cycle

   ![Group by Test Cycle](https://dev-assets.cms.uipath.com/assets/images/test-manager/test-manager-group-by-test-cycle-647202-2c8d4879-5b4a31d5.webp)
4. In the left-hand side **Group by** panel, consult the sprints and the number of associated test cases in brackets. Select a sprint and check the test case details. The “Unspecified” category includes all the test cases which do not have a custom field attached to them.

Figure 4. Group by Test Cycle - panel

   ![Group by Test Cycle - panel](https://dev-assets.cms.uipath.com/assets/images/test-manager/test-manager-group-by-test-cycle-panel-647206-61aaa733-614d2e53.webp)
5. From the **Group By** dropdown, select “Product Component”. Consult the components and the number of associated test cases in brackets. A structure emerges, allowing you to view if several test cases were run for a component or if a component was tested across several sprints.

Figure 5. Group by Product Component - panel

   ![Group by Product Component - panel](https://dev-assets.cms.uipath.com/assets/images/test-manager/test-manager-group-by-product-component-panel-647210-a8116714-5dfeb268.webp)
6. Next, apply filters or save your changes as a custom structured view.

## Steps
1. [Create custom fields](https://docs.uipath.com/test-manager/automation-cloud/latest/user-guide/creating-custom-fields) of the type **Label** and associate them with your test objects.
2. Go to the desired test object section (that is, Requirements/Test Cases/Test Sets).

Figure 6. Filter criteria for custom structured views

   ![Filter criteria for custom structured views](https://dev-assets.cms.uipath.com/assets/images/test-manager/test-manager-filter-criteria-for-custom-structured-views-646915-8e98bfd7-3689dac9.webp)
3. Select **Group by**, and select or clear the check boxes of the custom fields.
4. Select **Apply**.
5. Sort your groups. In the Group by panel, sort your groups ascending or descending using the available sort options. The Unspecified category is always last, irrespective of the sorting option you choose.
6. To revert your changes, in the **Group by** panel, select **Remove**.

## Result

Your test objects are grouped by the selected custom field values, and you can sort the groups or select **Remove** in the **Group by** panel to revert the grouping.
