We have configured a number of program rules using inOrgUnitGroup to restrict triggering to specific organisation unit level in the hierarchy. They work wonderfully within the event capture interface, however it does not work via API import (please note that the other program rules without the org unit restriction work fine through the API).
Due to our project’s requirements, events are initially recorded in an Excel template and then imported into DHIS2. Therefore, this configuration is critical for our implementation.
We have also tried using V{orgunit_group} without success. Can anyone please advice or help on an alternative?
Thanks for your explanation. Summarizing from your post, a reproduction of this issue would be to follow the following steps:
Create a program rule with condition that it triggers only when inOrgUnitGroup
Test that the program rule works when using the Capture app
Import values using the API - the inOrgUnitGroup filter doesn’t work.
Would you share the API request you are sending? Since you are importing using the API, wouldn’t it be possible to filter the values before importing? As an alternative, did you try to import using the Import/Export app?
Finally, please share what is the version of the DHIS2 instance that you are using.
@Gassim I may be the worst community member for not following up on this earlier—my apologies! We ended up tailing the logs of the server we were working on and confirmed that inOrgUnitGroup was throwing a bunch of errors, which explained why it wasn’t working for us.
Thank you so much for taking the time to respond, though. I, and I’m sure the other community members, really appreciate having you here to help us tackle these tough (and sometimes system-specific) issues on the community forum.
Here’s to more questions—and hopefully more solutions—this year!
It’s really great that you took the time to post an update about the issue. It helps resolve the topic and for other community members to understand what’s happening if they face a similar issue.