How to set a field required when changing status

Added by Andrii Shovkovyi over 1 year ago

I use custom fields in redmine and would like that when changing the value of one of the fields, the second changes the property from optional to required I tried using the formula

if (cfs [100] == "Test")
cfs [90].is_required = 1
end

but unfortunately this formula is not working