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.
CommCare Auto Case Close based on Parent Properties
commcare
Related Topic
- CommCare – Instance Syntax to Search for All Child Cases of a Parent
- Do CommCare Auto Case Closure case property filters overrule the Case Close field (days since updated)
- How to reference a child case in a display condition
- How to open a child case for a supply-point case in CommCare
- List the parent_name of a child case in the child case module case list
- Display the owner of a case in the case list
- CommCare – Configure Case List to Autoselect Child Case in Advanced Modules
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.