Hi all,
I am trying to generate a report which would give an attribute “backupowner” of roles/bundles. I am trying the below code for getting the attribute but the column does not have any value when the report is run. Am I missing something?
<ReportColumnConfig field="backupOwner" header="rept_role_details_col_backupOwner" width="110">
<RenderScript>
<Source>
import sailpoint.tools.Util;
String roleName = (String) renderCache.get(value);
if (roleName != null) {
Identity pickedRole = context.getObject(Bundle.class, roleName);
if (pickedRole != null) {
return pickedRole.getAttribute("backupOwner");
}
return "";
</Source>
</RenderScript>
</ReportColumnConfig>
Hi @rishavghoshacc ,
Try with below code.
<ReportColumnConfig field="backupOwner" header="rept_role_details_col_backupOwner" property="name" width="110">
<RenderScript>
<Source>
import sailpoint.tools.Util;
String roleName = value;
if (roleName != null) {
Bundle pickedRole = context.getObject(Bundle.class, roleName);
if (pickedRole != null) {
return pickedRole.getAttribute("backupOwner");
}
return "";
</Source>
</RenderScript>
</ReportColumnConfig>
@Arun-Kumar it still comes out as empty
Hi @rishavghoshacc ,
Print the value and check whether you get the value or not.
What is the objectType of the report? Is it Bundle?
Could you please share the report xml?
Bundle having beackupOwner attribute?
@Arun-Kumar Backupowner is just an attribute that is added to the bundles. It is working when I try to get through a rule. Logs does not having anything
PFA xml
Role Backup Owners Report.xml (3.8 KB)
Hi @rishavghoshacc ,
RenderScript will not work on Java datasource. You can create a new report with Filter datasource.
1 Like
It seems like you’re working with a Java-based report in SailPoint that was originally implemented for a different purpose. When you attempted to extend it by adding custom logic specifically for the backupOwner
field that’s where the issue arises. The core problem is that the report’s Java class, likely RoleDetailsDataSource
, doesn’t include logic to handle the backupOwner
field. Even though you tried adding a renderScript
to address this, it still fails. Why? Because the ReportColumnConfig
field name you’re referencing isn’t defined in the Java class. As a result, the class doesn’t recognize it, and the value returned for that field will be null.
To better understand what’s happening under the hood, I’d recommend using IntelliJ or a decompiler to inspect the implemented logic in the RoleDetailsDataSource
class. This will give you a clearer picture of how the class processes data and why it’s not accommodating your custom field.
That said, here are my suggestions:
- If you want to develop a fully custom Java-based report: Check out this SailPoint Community blog post for a step-by-step guide on creating reports with a Java DataSource: Reporting with a Java DataSource. It’s a solid resource for building something tailored to your needs from scratch.
- If you prefer using HQL or filter-based logic: Take a look at SailPoint’s OOTB reports. These often leverage HQL or filters and might offer a simpler way to achieve your goal without diving too deep into custom Java code.
For more info, I’d also recommend reviewing SailPoint’s official reporting documentation. It’ll provide additional context on how reports are structured and what options are available to you. Let me know if you need help with specific steps!
@Arun-Kumar I got it to work. Thanks to you.
Can you help me in skipping the roles that don’t have the attribute. At the moment I am getting all the roles even if the attribute is not there
HI @rishavghoshacc ,
If you’re creating a report with a Filter datasource, include the QueryScript
in the QueryParameter section. Also, ensure that the backupOwner
attribute is marked as searchable.
<QueryParameters>
<Parameter argument="BackupOwner" property="name">
<QueryScript>
<Source>
import sailpoint.object.QueryOptions;
import sailpoint.object.Filter;
queryOptions.addFilter(Filter.notnull("backupOwner"));
return queryOptions;
</Source>
</QueryScript>
</Parameter>