[midPoint] Synchronization condition not executed when using task

SINGH Abhishek Kumar abhishek-kumar.singh at thalesgroup.com
Wed May 3 17:50:20 CEST 2023


Hello,

I am using a script in condition under synchronization to synchronize only those users that belong to given set of groups.
I am using msgraph connector and the script being used is:

    <synchronization>
        <objectSynchronization>
            <name>Account</name>
            <objectClass>ri:AccountObjectClass</objectClass>
            <kind>account</kind>
            <intent>default</intent>
            <focusType>c:UserType</focusType>
            <enabled>true</enabled>
            <condition>
                <script>
                    <code>
def groupsList = ["Group1", "Group2"]
def groupNames = shadow.getAssociation().collect {
it.getShadowRef().getTargetName().toString()?.toLowerCase()
}
return groupNames.any { it in groupsList.collect { it?.toLowerCase()}}

                      </code>
                </script>
            </condition>
                .....

</objectSynchronization>
    </synchronization>


The script works fine when I manually import the users by clicking the import button on the accounts tab.
But, it skips all the users and no synchonization takes place when I import the users using import task.
Similarly, the other task for users are also not working.
The groupNames variable used abve is null in case of using tasks. this means the script is not able to fetch the association details of a user while using tasks.

Can anyone suggest some alternative method to so that I can filter the users based on membership while using the tasks.

Regards,
Abhishek

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20230503/7b868aee/attachment.htm>


More information about the midPoint mailing list