Draft: Filter by text and number custom fields

What does this MR do and why?

This change enhances the custom field filtering capabilities for work items by adding support for number and text field types alongside the existing select field type. The GraphQL API has been updated to include new arguments (numberValue and textValue) in the custom field filter input type, allowing users to filter work items based on these additional field types. The backend filtering logic has been refactored to handle these new field types by introducing dedicated methods for filtering by number and text values. The code also includes validation to ensure that only one type of filter value is provided at a time. Tests have been added to verify the new filtering capabilities work correctly across different field types and combinations.

References

Screenshots or screen recordings

Before After

How to set up and validate locally

You will need to create some text and number custom fields in your root namespace. After that you need to add some values on those custom fields, by opening the work item and adding the value.

Some sample GraqhQL queries

query($customField: [WorkItemWidgetCustomFieldFilterInputType!] ) {
  project(fullPath: "flightjs/Flight") {
    id
    issues(customField: $customField) {
      nodes {
       id 
       iid
        title
      }
    }
  }
}
{
  "customField": [
    {
      "customFieldId": "gid://gitlab/Issuables::CustomField/4",
      "selectedOptionIds": ["gid://gitlab/Issuables::CustomFieldSelectOption/1"]
    },
    {
      "customFieldId": "gid://gitlab/Issuables::CustomField/1",
      "numberValue": 1
    }
  ]
}

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stefanos Xanthopoulos

Merge request reports

Loading