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
- Login to the GDK and verify the test cases below.
- Global Search - All Work Items: http://gdk.test:3000/api/v4/search?scope=work_items&search=test
- Global Search - Filter by Type (Single): http://gdk.test:3000/api/v4/search?scope=work_items&search=test&type[]=task
- Global Search - Filter by Type (Multiple): http://gdk.test:3000/api/v4/search?scope=work_items&search=test&type[]=task&type[]=issue
- Group Search - Work Items: http://gdk.test:3000/api/v4/groups/29/search?scope=work_items&search=test
- Group Search - With Type Filter: http://gdk.test:3000/api/v4/groups/29/search?scope=work_items&search=test&type[]=task
- Project Search - Work Items: http://gdk.test:3000/api/v4/projects/5/search?scope=work_items&search=test
- Project Search - With Type Filter: http://gdk.test:3000/api/v4/projects/5/search?scope=work_items&search=test&type[]=issue
- Combined Filters - State + Type: http://gdk.test:3000/api/v4/search?scope=work_items&search=test&type[]=task&state=opened
- Combined Filters - Confidential + Type: http://gdk.test:3000/api/v4/search?scope=work_items&search=test&type[]=issue&confidential=false
- 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)