[midPoint] Querying users roles/assignments with a script/expression

Jussi Jokela jussi.jokela at fiarone.com
Fri Sep 9 15:10:26 CEST 2022


Hi everyone,

I was able to solve this. The following script produces wanted results:

                                    <script xmlns="">
                                        <code>
                                            body = "";

                                            for (Object o : (ArrayList)event.object.asObjectable().assignment.targetRef.targetName) {
                                                body = body + o + "\n";
                                            }
                                            return body;
                                        </code>
                                    </script>

Without the for-each loop the assignment.targetRef.targetName returns all the assignments as a single string.



Best regards,
Jussi Jokela
________________________________
From: midPoint <midpoint-bounces at lists.evolveum.com> on behalf of Jussi Jokela via midPoint <midpoint at lists.evolveum.com>
Sent: Wednesday, September 7, 2022 14:06
To: MidPoint Mailing List <midpoint at lists.evolveum.com>
Cc: Jussi Jokela <jussi.jokela at fiarone.com>
Subject: [midPoint] Querying users roles/assignments with a script/expression

Hi everyone,

I'm creating a task that should be able to send a list of users roles/assignments through email. However, I haven't found a way how to fetch these using a script or expression? I already know users oid (search query), if this helps. And I'm using notify action to send said email.


Best regards,
Jussi Jokela
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220909/6403c272/attachment.htm>


More information about the midPoint mailing list