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

Screenshots or screen recordings

With a full_path Screenshot_2026-02-17_at_11.44.04_PM
Without a full_path Screenshot_2026-02-17_at_11.43.49_PM
Duplicate Name in same namespace Screenshot_2026-02-17_at_11.43.36_PM
With FF disabled Screenshot_2026-02-17_at_11.44.22_PM
Invalid Icon Name Screenshot_2026-02-17_at_11.53.24_PM

How to set up and validate locally

  1. Turn on the FF work_item_configurable_types.
  2. Execute the mutation with fullpath (creates the type at group level)/ without fullpath (creates for current organization).
mutation {
  workItemTypeCreate(input: {
    fullPath: "your-group-path"
    name: "Custom Bug Type"
    iconName: "bug"
  }) {
    workItemType {
      id
      name
      iconName
    }
    errors
  }
}
  1. Ensure that the custom work item types were persisted in the database with the correct organization_id/namespace_id
  2. 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

Merge request reports

Loading