<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi everyone,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
I was able to solve this. The following script produces wanted results:<br>
<br>
<script xmlns="">
<div> <code></div>
<div> body = "";</div>
<div><br>
</div>
<div class="elementToProof"> for (Object o : (ArrayList)event.object.asObjectable().assignment.targetRef.targetName) {</div>
<div class="elementToProof"> body = body + o + "\n";</div>
<div> }</div>
<div class="elementToProof"> return body;</div>
<div> </code></div>
</script><br>
</div>
<div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Without the for-each loop the assignment.targetRef.targetName returns all the assignments as a single string.<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Best regards,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Jussi Jokela<br>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> midPoint <midpoint-bounces@lists.evolveum.com> on behalf of Jussi Jokela via midPoint <midpoint@lists.evolveum.com><br>
<b>Sent:</b> Wednesday, September 7, 2022 14:06<br>
<b>To:</b> MidPoint Mailing List <midpoint@lists.evolveum.com><br>
<b>Cc:</b> Jussi Jokela <jussi.jokela@fiarone.com><br>
<b>Subject:</b> [midPoint] Querying users roles/assignments with a script/expression</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
Hi everyone,</div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
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.</div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
Best regards,</div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
Jussi Jokela<br>
</div>
</div>
</body>
</html>