CommCare Auto Case Close based on Parent Properties

commcare

Is it possible to do an auto-close case rule based on a parent property? I'm particularly interested in auto-closing child cases whose parents are closed.

Best Answer

It is possible to have the criteria in an auto-case close rule reference a parent case. You can just prefix the case property name with "parent/". So for example, to close all child cases whose parent has a case property named "marked_for_close" set to "yes", the criteria would be:

parent/marked_for_close | equals | yes

Currently though, the equals comparison only allows for string comparison, and the value for closed is stored internally as a boolean, so that wouldn't work to check for parent/closed.