diff --git a/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb b/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb index 9e2855805b2..df57f93cbae 100644 --- a/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb +++ b/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb @@ -224,7 +224,7 @@ class CostQuery::PDF::TimesheetGenerator href = url_helpers.work_package_url(entry.entity) { - content: "#{make_link_href(href, "##{entry.entity.id}")} #{entry.entity.subject || ''}", + content: "#{make_link_href(href, entry.entity.formatted_id)} #{entry.entity.subject || ''}", inline_format: true } end diff --git a/modules/reporting/spec/workers/cost_query/pdf/timesheet_generator_spec.rb b/modules/reporting/spec/workers/cost_query/pdf/timesheet_generator_spec.rb index 3b6889d19e9..8b4012e39b3 100644 --- a/modules/reporting/spec/workers/cost_query/pdf/timesheet_generator_spec.rb +++ b/modules/reporting/spec/workers/cost_query/pdf/timesheet_generator_spec.rb @@ -227,4 +227,16 @@ RSpec.describe CostQuery::PDF::TimesheetGenerator do expect(subject).to eq expected_document(false) end end + + context "with semantic work package identifiers", + with_settings: { work_packages_identifier: "semantic", allow_tracking_start_and_end_times: false } do + before do + user_time_entry.entity.update_columns(identifier: "PROD-42", sequence_number: 42) + end + + it "renders the semantic identifier in the work package column" do + expect(subject).to include("PROD-42") + expect(subject).not_to include("##{user_time_entry.entity.id}") + end + end end