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

set workspace_type on project creation via API

ulfertsc7ad317469c8
diff --git a/lib/api/v3/projects/projects_api.rb b/lib/api/v3/projects/projects_api.rb
index 67e11d525d3..cb1ab660c59 100644
--- a/lib/api/v3/projects/projects_api.rb
+++ b/lib/api/v3/projects/projects_api.rb
@@ -40,7 +40,11 @@ module API
})
.mount
- post &::API::V3::Utilities::Endpoints::Create.new(model: Project)
+ post &::API::V3::Utilities::Endpoints::Create.new(model: Project,
+ params_modifier: ->(attributes) {
+ attributes[:workspace_type] = Project.workspace_types[:project]
+ attributes
+ })
.mount
mount ::API::V3::Projects::Schemas::ProjectSchemaAPI