OrganisationUnit API: Ordering by level seems to not work on 2.36.4

Hi there

In versions below 2.36 this /api/organisationUnits.json?fields=id,name,parent,level&order=level:asc used to work and results will be ordered in ascending order given the level. But now same api brings error in 2.36 will the following message

“httpStatus”: “Internal Server Error”,
“httpStatusCode”: 500,
“status”: “ERROR”,
“message”: “Unable to locate Attribute with the the given name [null] on this ManagedType [org.hisp.dhis.organisationunit.OrganisationUnit]”

Apparently the this error can also be replicated in DHIS 2 Demo - Sierra Leone, and error is only on ordering by level (other attributes work as expected)

Has anything changed on 2.36? Or is there anything that I am missing here?


Hi @rajab_mkomwa,
Thank you for your post! Please try &order=organisationUnit[level]:asc instead of using directly level. I hope this works. :relaxed:

Hi @Gassim,

Unfortunately the suggested solution still does not order organisation units by level, it is like there is no effect on the result with or without it.

1 Like

Hi @rajab_mkomwa,
Thank you for your patience! Would you like to create a Jira bug issue in You’d need to have a Jira account to create an issue.