Loading
Stop issues CSV import when the Issue type is unavailable
What does this MR do and why?
Stops an issues CSV import upfront when the Issue work item type is disabled or archived for the project. This runs only when enforce_work_item_type_availability is on.
With the flag on and the type unavailable, every row would fail on create. The import now checks the type once in preprocess! and stops. The completion email says the type is unavailable and that nothing was imported. Before, it listed a failure per row.
With the flag off, nothing changes.
References
- Part of the split of !260607 (merged).
- Depends on !260607 (merged) (stacked).
How to set up and validate locally
- Disable the Issue type for a project in the work item settings.
- Enable the flag with
Feature.enable(:enforce_work_item_type_availability). - Import an issues CSV into the project.
- The completion email, HTML and text, says the Issue type is disabled or archived and that no issues were imported.
- Disable the flag and import again. The old behaviour is back.
Specs:
ee/spec/services/ee/issues/import_csv_service_spec.rbspec/mailers/emails/issues_spec.rbspec/views/notify/import_issues_csv_email.html.haml_spec.rb
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist.
Generated with Claude Code