Need help with selection from group in rule

rule "Состояние кнопок"
when
Item gButtons changed
then
gButtons.members.filter( item| item.state == ON ).forEach( item| item.postUpdate(OFF))
end

How i can postUpdate for all items in group gButtons but exclude only one item with name “test”?
i need something like this “gButtons.members.filter( item| item.name != “test” )” but it doesn’t work.

gButtons.members.forEach[item | if(item.name != "test") item.postUpdate(OFF)]

Did you mean this?

gButtons.members.filter[item|item.name !="test"].forEach[item|item.postUpdate(OFF)]

I’m surprised that doesn’t work. I do similar things in my rules with no problems.

Thank you! Everything works as needed! Best wishes!