Create work item tickets instead of issues for Service Desk emails
What does this MR do and why?
This MR updates Service Desk email handling to create work item tickets instead of issues when emails are received, supporting the broader Service Desk migration to Work Items.
Key Changes
Backend Changes:
-
Service Desk Handler: Modified Service Desk handler to create work items with ticket type when
service_desk_ticketfeature flag is enabled. - Email Templates: Updated all Service Desk email templates to work with work items instead of issues while maintaining backward compatibility.
- Mailer Updates: Refactored Service Desk mailer to handle both issues and work item tickets seamlessly.
- Notification Service: Enhanced to send Service Desk notifications for both Issue and WorkItem noteables.
- Hierarchy Support: Added support for Epic → Ticket relationships in work item hierarchy.
Email Infrastructure:
-
Headers: Added new
X-GitLab-WorkItem-*headers while preserving legacyX-GitLab-Issue-*headers for backward compatibility. - Template Variables: Updated template substitution to work with work items.
- Custom Email Support: Maintained full compatibility with Service Desk custom email functionality.
Feature Flag Behavior
- When
service_desk_ticketis enabled: Creates ticket work items for new Service Desk emails. - When
service_desk_ticketis disabled: Maintains existing behavior (creates issues). - Backward Compatibility: Existing Service Desk issues continue to work normally.
References
Screenshots or screen recordings
| With FF off | With FF on |
|---|---|
|
|
|
|
How to set up and validate locally
- Enable the
service_desk_ticketfeature flag. - Set up Service Desk by following the instructions here.
- Send an email to create a new ticket.
- Navigate to the Service Desk issue list, for example:
http://127.0.0.1:3000/private-group-1/private-project-1/-/issues/service_desk. - Verify that the resulting work item is a ticket, not an issue.
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 Agnes Slota



