anteo / redmine_custom_workflows

Allows to create custom workflows for Redmine
http://www.redmine.org/plugins/custom-workflows
GNU General Public License v2.0
182 stars 72 forks source link

control number of subtask #241

Closed ashrafalzyoud closed 2 years ago

ashrafalzyoud commented 2 years ago

if u can help me plz how i can let user added only limit of subtask depend in custom_field_value type integer example if custome_field_value_1= 5 this mean user can added only maximum 5 subtask

ashrafalzyoud commented 2 years ago

@picman

AirTibu commented 2 years ago

Hi,

You should run this code in BEFORE SAVE section of your SUBTASK:


if self.parent
if parent.children.count == 5
errors.add(:base,"The maximum number of subtasks has been reached. Creating additional subtasks is not allowed.")
end
end

I hope it helps!