openproject
openproject copied to clipboard
[#54459] Add `AvailableProjectAttributesFilter` to project queries to display the mapped projects list in projects attribute settings view
https://community.openproject.org/work_packages/54459
Wat?
Project Attributes are ProjectCustomFields, when they are activated within a project a mapping is created in the join table ProjectCustomFieldProjectMapping
How
Add a new filter that runs an inclusion search against ProjectCustomFieldProjectMapping join table, returning a list of projects where the given custom_field_ids values match
Example
query = Queries::Projects::ProjectQuery.new(name: "test") do |query|
query.where(:available_project_attributes, '=', [13, 14])
end
query.results