Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add `derived_done_ratio` to the work package schema representer

Aaron Contrerasa331032cdc06
diff --git a/lib/api/v3/work_packages/schema/work_package_schema_representer.rb b/lib/api/v3/work_packages/schema/work_package_schema_representer.rb
index 31afb296b69..244d1b1f0f8 100644
--- a/lib/api/v3/work_packages/schema/work_package_schema_representer.rb
+++ b/lib/api/v3/work_packages/schema/work_package_schema_representer.rb
@@ -188,6 +188,12 @@ module API
show_if: ->(*) { Setting.work_package_done_ratio != 'disabled' },
required: false
+ schema :derived_percentage_done,
+ type: 'Integer',
+ name_source: :derived_done_ratio,
+ show_if: ->(*) { Setting.work_package_done_ratio != 'disabled' },
+ required: false
+
schema :readonly,
type: 'Boolean',
show_if: ->(*) { Status.can_readonly? },