{“httpStatus”:“Conflict”,“httpStatusCode”:409,“status”:“ERROR”,“message”:“org.hibernate.PropertyValueException: not-null property references a null or transient value : org.hisp.dhis.category.Category.uid”}
A similar request pattern to update a data element group does seem to work though (again, may need to modify the DE uid to make sure it’s not previously been added):
I tried everything to see how it could work but exactly the same issue. I noticed that /categories has both categoryOptions as well as items compared to dataElementGroups, it has only dataElements which means the DE needs to be added to only one path whereas in the categories it needs to be added twice (at the same time?)
It’s either that this functionality is not yet supported for this endpoint for a certain complexity or that this is a bug. I am triaging this to the software team, thank you for reporting here @plinnegan !
I tested the PATCH feature for the first time because of you, thanks!
Do you know if there’s been any updates on this? Something like what versions the dev team would expect the fix to be in would be really helpful for us to know in terms of planning if we need to develop a work around in the meantime or not.
Perhaps only tangentially related, but I’ve always lamented how for category options we can’t simply import in metadata with category inclusion in order for the category options to be assigned to a particular category; we always have to pull and do a merge PUT request on the category with the specific category options after they are in the system. Would love it if this were more streamlined, much like programRuleActions, options, etc. are able to do!
Usually this is determined when a ticket on jira is created so I will let you know when it is. If you actually have a workaround, it’d be great to see how you’d handle this issue Usually the fix covers all the latest versions but since this is a new feature I’m not sure as well.
This it is true @Matthew_Boddie but I think it’s possible using the Import / Export app, so I’m wondering if there’s actually away …
I’m definitely not able to assign or unassign COs to categories (with {"categoryOptions":[]} package)using the import/export. I honestly never thought to create a ticket for this, but if you’re saying it could/should be a possibility, I’ll make one for it!