Declare work_item_type_ids as first-class REST API filter param

What does this MR do and why?

Formally declares the work_item_type_ids filter on the Work Items REST list endpoint (project + group). Previously the param was undeclared but worked because the raw params hash was passed through to the finder. This formalizes it with proper typing, coercion, and validation.

Changes:

  • Declares work_item_type_ids as an optional Array[Integer] param in the top-level filter block, with CommaSeparatedToIntegerArray coercion
  • Declares work_item_type_ids in the not block for negated filtering
  • Adds mutually_exclusive :types, :work_item_type_ids in both blocks to guard against the silent-AND footgun while types still exists
  • No transformer change needed: the key already matches the finder key (work_item_type_ids flows directly to WorkItemsFinderIssueTypesFilter#by_work_item_type_idswith_work_item_type_ids scope)
  • Adds filter tests covering positive filter, array OR, negation, and mutual exclusivity with types
  • Removes work_item_type_ids from parity spec known_exceptions now that the param is declared

This is step 1 of 2; step 2 will remove the types filter separately (parent: #605888 (closed)).

Closes #605896 (closed)

References

Screenshots or screen recordings

N/A — API-only change, no UI changes.

How to set up and validate locally

  1. Start the Rails server
  2. Create a work item of type Task (type ID 5) in a project
  3. Call GET /api/v4/projects/:id/-/work_items?work_item_type_ids[]=5 — returns only Task work items
  4. Call GET /api/v4/projects/:id/-/work_items?work_item_type_ids[]=5&work_item_type_ids[]=1 — returns Tasks and Issues
  5. Call GET /api/v4/projects/:id/-/work_items?not[work_item_type_ids][]=5 — excludes Tasks
  6. Call GET /api/v4/projects/:id/-/work_items?types=task&work_item_type_ids[]=5 — returns 400 with mutually exclusive error

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.

Merge request reports

Loading
Loading