diff --git a/app/views/work_packages/bulk/_errors.html.erb b/app/views/work_packages/bulk/_errors.html.erb
index 720e063cdd4..6ed5bf295b5 100644
--- a/app/views/work_packages/bulk/_errors.html.erb
+++ b/app/views/work_packages/bulk/_errors.html.erb
@@ -31,10 +31,12 @@
<% erroneous_results.each do |call| %>
- <% wp_id = call.state.copied_from_work_package_id || call.result.id %>
+ <% source_id = call.state.copied_from_work_package_id %>
+ <% wp = source_id ? WorkPackage.find_by(id: source_id) : call.result %>
+ <% wp_id = wp&.id || call.result.id %>
-
- <%= link_to "##{wp_id}", work_package_path(wp_id) %><%= selected_work_packages.map(&:id).include?(wp_id) ? "" : " (#{I18n.t('work_packages.bulk.descendant')})" %>:
+ <%= link_to wp&.formatted_id || "##{wp_id}", work_package_path(wp_id) %><%= selected_work_packages.map(&:id).include?(wp_id) ? "" : " (#{I18n.t('work_packages.bulk.descendant')})" %>:
<%= safe_join call.errors.full_messages, " " %>
<% end %>
diff --git a/spec/controllers/work_packages/bulk_controller_spec.rb b/spec/controllers/work_packages/bulk_controller_spec.rb
index 72c297a2b98..8754bc387e7 100644
--- a/spec/controllers/work_packages/bulk_controller_spec.rb
+++ b/spec/controllers/work_packages/bulk_controller_spec.rb
@@ -583,6 +583,29 @@ RSpec.describe WorkPackages::BulkController, with_settings: { journal_aggregatio
end
end
+ context "with semantic identifiers",
+ with_settings: { work_packages_identifier: "semantic" } do
+ before do
+ work_package1.update_columns(identifier: "PROJ-1", sequence_number: 1)
+ work_package2.update_columns(identifier: "PROJ-2", sequence_number: 2)
+ put :update,
+ params: {
+ ids: work_package_ids,
+ work_package: { done_ratio: 150 }
+ }
+ end
+
+ it "shows semantic identifiers in the error flash" do
+ expect(flash[:error]).to include("PROJ-1")
+ expect(flash[:error]).to include("PROJ-2")
+ end
+
+ it "does not show bare numeric ids in the error flash" do
+ expect(flash[:error]).not_to include("##{work_package1.id}")
+ expect(flash[:error]).not_to include("##{work_package2.id}")
+ end
+ end
+
describe "updating two children with dates to a new parent (Regression #28670)" do
let(:task1) do
create(:work_package,