Hello,
here in bellow code i need to get members of items. it does not work. seems it is not possible to call items like that.
in another report i use IdentityRequest.getItems() (i use this construction inside of
and is it possible to call field A inside RenderScript of field B (if take code bellow as example, to call “Name” - check if it > 1000 and based on that return something in field “items”)? i.e. use two or more attributes of object inside one ReportColumnConfig.
if yes, how?
thank you in advance!
depending on information in property/attribute/field “name” i want to return different values for property “items”. for example - if “name” > 1000 then for “items” return null otherwise return “items.application”.
another question is how to get items of IdentityRequest (items here are IdentityRequestitem objects). actually i do not need objects, i just need one of the attributes (i.e. Application).
you can implement the logic within a RenderScript block. The identity request can be accessed either by its name or id property. Once you have the IdentityRequest object, you can retrieve the identityRequestItems associated with it. From each identityRequestItem, you can extract the application information.
<DataSource defaultSort="name" objectType="sailpoint.object.IdentityRequest" type="Filter"/>
<Columns>
<ReportColumnConfig field="id" header="id" property="id" width="110"/>
<ReportColumnConfig field="Name" header="Name" property="name" width="110"/>
<ReportColumnConfig field="items" header="items" property="name" width="110">
<RenderScript>
<Source>
import sailpoint.object.IdentityRequest;
import sailpoint.object.IdentityRequestItem;
String appName = null;
List appList = new ArrayList();
if (value != null) {
IdentityRequest ir = context.getObjectById(IdentityRequest.class, value);
if (ir != null) {
List items = ir.getItems();
if (items != null @and !items.isEmpty()) {
for (IdentityRequestItem item : items) {
appName = item.getApplication();
appList.add(appName);
}
}
return appList;
</Source>
</RenderScript>
</ReportColumnConfig>
</Columns>
Hello Arun
thank you for responce and code.
this method solves both of my questions, but i am looking for some more elegant solution.
i do not want to call context.getobject or search inside ReportColumnConfig to get the same object which is already iterated.
this was just example. imagine there are multiple attributes/properties/fields like this, with context.getobjects, would not it affect performance of the report?
Typically, when using methods like context.getObjects or context.search, we are working with scenarios where we don’t have direct access to the exact objectName or objectId. In the case of IdentityRequest, the name and id properties serve as the identifiers, which allow us to directly reference the correct IdentityRequest object.
To clarify, when we use context.getObjectByName(IdentityRequest.class, value), we are not iterating over all IdentityRequest objects. Instead, we are directly retrieving the specific object based on the provided name or id, which eliminates the need for a full search. This targeted retrieval of a single object ensures that there is no significant performance impact on the report, even if there are multiple fields or properties to consider.