Draft: feat(workitems): Implement CreateWorkItem().
What does this MR do and why?
Issue: #2219
This merge request adds the ability to create new work items (like tasks, issues, or epics) in GitLab projects. The changes include:
New functionality:
- Added a
CreateWorkItemmethod that allows users to create different types of work items by providing a title and optional details like description, assignees, due dates, labels, and other metadata - Created comprehensive input structures to handle all the different properties a work item can have when being created
- Added predefined work item type constants (Issue, Task, Epic, etc.) for easy reference
Error handling:
- Added a new error type specifically for when an item response was expected but not received
- Proper error handling for both network issues and validation errors from GitLab
Testing and mocking:
- Generated mock implementations for testing purposes
- Added comprehensive test cases covering successful creation scenarios and error cases
The implementation uses GitLab's GraphQL API to create work items and transforms user-friendly input options into the specific format required by GitLab's backend. This gives developers a clean, easy-to-use interface for programmatically creating work items while handling all the complex GraphQL formatting behind the scenes.
Edited by Florian Forster