Add API Support for work_items and support type filter

What does this MR do and why?

This change adds support for searching "work items" in GitLab's search functionality. Work items are a broader category that includes issues, tasks, epics, incidents, test cases, requirements, objectives, key results, and tickets.

The update adds "work_items" as a new search scope alongside existing options like issues, merge requests, and projects. It also introduces a new filter parameter called "type" that allows users to narrow down work item searches by specific types (like only searching for tasks or epics). The confidentiality and state filters that previously only worked with issues now also work with work items.

The API documentation is updated to reflect these new capabilities, and a new data structure is defined to represent work items in search results. This enhancement gives users more flexibility to search across different types of work items in GitLab projects and groups.

References

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Login to the GDK and verify the test cases below.
  2. Global Search - All Work Items: http://gdk.test:3000/api/v4/search?scope=work_items&search=test
  3. Global Search - Filter by Type (Single): http://gdk.test:3000/api/v4/search?scope=work_items&search=test&type[]=task
  4. Global Search - Filter by Type (Multiple): http://gdk.test:3000/api/v4/search?scope=work_items&search=test&type[]=task&type[]=issue
  5. Group Search - Work Items: http://gdk.test:3000/api/v4/groups/29/search?scope=work_items&search=test
  6. Group Search - With Type Filter: http://gdk.test:3000/api/v4/groups/29/search?scope=work_items&search=test&type[]=task
  7. Project Search - Work Items: http://gdk.test:3000/api/v4/projects/5/search?scope=work_items&search=test
  8. Project Search - With Type Filter: http://gdk.test:3000/api/v4/projects/5/search?scope=work_items&search=test&type[]=issue
  9. Combined Filters - State + Type: http://gdk.test:3000/api/v4/search?scope=work_items&search=test&type[]=task&state=opened
  10. Combined Filters - Confidential + Type: http://gdk.test:3000/api/v4/search?scope=work_items&search=test&type[]=issue&confidential=false
  11. Invalid Type - Error Handling: http://gdk.test:3000/api/v4/search?scope=work_items&search=test&type[]=invalid_type

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.

Related to #588632 (closed)

Edited by Siddharth Dungarwal

Merge request reports

Loading
Loading