Description:
After performing a merge using the Organisation Unit Merge API, the target organisation unit (which was originally at a specific level within the organisation unit tree) ends up being displayed as a top-level organisation unit in the tree, despite being in its respective position before the merge.
Steps to Reproduce:
- Perform a merge by using superuser like system through the Organisation Unit Merge API with the following payload with a
POST
request to/api/organisationUnits/merge
:{ "sources": [ "zsqxu7ZZRpO", "nurO6U9bOLi" ], "target": "PwoQgMJNWbR", "dataValueMergeStrategy": "LAST_UPDATED", "dataApprovalMergeStrategy": "LAST_UPDATED", "deleteSources": true }
- After the merge completes successfully (status
200 OK
), observe the organisation unit tree. - The target organisation unit (
PwoQgMJNWbR
) appears as a top-level unit, despite having been at a different level in the hierarchy before the merge.
Expected Behavior:
The target organisation unit (PwoQgMJNWbR
) should retain its original position within the hierarchy after the merge and should not be displayed as a top-level unit.
Actual Behavior:
After the merge, the target organisation unit (PwoQgMJNWbR
) incorrectly appears as a top-level organisation unit in the tree.
Environment Details:
- DHIS2 Version: 2.41 to 2.39
- API Endpoint Used:
/api/organisationUnits/merge
Additional Information:
- The merge completes successfully and the data from the source organisation units (
zsqxu7ZZRpO
,nurO6U9bOLi
) is consolidated into the target (PwoQgMJNWbR
). - The issue only affects the organisational hierarchy position of the target organisation unit.