Add WorkItemTypeCreate GraphQL mutation
Issue: [BE] Create workItemTypeCreate mutation (#581937 - closed)
What does this MR do and why?
This merge request adds a new feature to create custom work item types. The changes introduce a GraphQL mutation called workItemTypeCreate that allows users to create new work item types with custom names and icons.
The feature includes:
- A new API endpoint for creating work item types with validation for required fields like name and optional icon selection
- Support for creating types at both the group level (for root groups only) and organization level
- A set of predefined icons that users can choose from (like bug, epic, feature, task, etc.)
- Proper permission checks to ensure only authorized users (maintainers and owners) can create custom types
- Error handling for invalid inputs and unauthorized access attempts
References
- [BE] Create workItemTypeCreate mutation (#581937 - closed)
- Add WorkItemTypeUpdate GraphQL mutation (!223505 - merged)
Screenshots or screen recordings
With a full_path
|
|
Without a full_path
|
|
| Duplicate Name in same namespace |
|
| With FF disabled |
|
| Invalid Icon Name |
|
How to set up and validate locally
- Turn on the FF
work_item_configurable_types. - Execute the mutation with
fullpath(creates the type at group level)/ withoutfullpath(creates for current organization).
mutation {
workItemTypeCreate(input: {
fullPath: "your-group-path"
name: "Custom Bug Type"
iconName: "bug"
}) {
workItemType {
id
name
iconName
}
errors
}
}
- Ensure that the custom work item types were persisted in the database with the correct organization_id/namespace_id
- In the rails console check
bin/rails c
WorkItems::TypesFramework::Custom::Type.last
=> #<WorkItems::TypesFramework::Custom::Type:0x0000000147af6a98
id: 1001,
created_at: "2026-02-18 04:44:00.818292000 +0000",
updated_at: "2026-02-18 04:44:00.818292000 +0000",
organization_id: nil,
namespace_id: 143,
icon_name: "bug",
converted_from_system_defined_type_identifier: nil,
name: "Custom Bug 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.
Edited by Daniyal Arshad




