Hi, I am writting custom report and right now I have situation like this:
if you have Business Role 1 with required: IT Role 1 and IT Role 2, permitted: IT Role 3, my report will show me in one row:
Business Role | Required IT Roles | Permitted IT Roles
Business Role 1 | IT Role 1, IT Role 2 | IT Role 3.
But I prefer to have report like this:
Business Role | IT Roles | Permitted/Required
Business Role 1 | IT Role 1 | Required
Business Role 1 | IT Role 2 | Required
Business Role 1 | IT Role 3 | Permitted
How I can create report like that? I donât how to change a row when I have more than one IT Roles related to Business Role and I donât know how to add another column with information about relation IT Role to Business Role (permitted/required). Here is my code:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<TaskDefinition executor="sailpoint.reporting.LiveReportExecutor" name="Roles Report TEST" progressMode="Percentage" resultAction="Rename" subType="Custom Reports" template="true" type="LiveReport">
<Attributes>
<Map>
<entry key="report">
<value>
<LiveReport title="Roles Report TEST">
<DataSource objectType="Bundle" type="Filter">
<QueryParameters>
<Parameter defaultValue="business" property="type" valueClass="string" />
</QueryParameters>
</DataSource>
<Columns>
<ReportColumnConfig field="businessRoles" header="Business role" property="id" sortable="true" width="110">
<RenderScript>
<Source>
import sailpoint.object.*;
Bundle bundle = null;
try{
bundle = context.getObjectById(Bundle.class,value);
return bundle.getName();
}
catch (Exception e){
if (null != bundle && null != bundle.getName()){
return "error getting profiles for " + bundle.getName() + ": " + e.getMessage();
}
else{
return "null role";
}
}
</Source>
</RenderScript>
</ReportColumnConfig>
<ReportColumnConfig field="ritRoles" header="Required IT roles" property="id" sortable="true" width="110">
<RenderScript>
<Source>
import sailpoint.object.*;
Bundle bundle = null;
try{
bundle = context.getObjectById(Bundle.class,value);
Collection requirements = bundle.getRequirements();
List rolesStrings = new ArrayList();
for (Bundle itRole: requirements){
String itName = itRole.getName();
rolesStrings.add(itName);
}
return rolesStrings;
}
catch (Exception e){
if (null != bundle && null != bundle.getName()){
return "error getting profiles for " + bundle.getName() + ": " + e.getMessage();
}
else{
return "null role";
}
}
</Source>
</RenderScript>
</ReportColumnConfig>
<ReportColumnConfig field="pitRoles" header="Permitted IT roles" property="id" sortable="true" width="110">
<RenderScript>
<Source>
import sailpoint.object.*;
Bundle bundle = null;
try{
bundle = context.getObjectById(Bundle.class,value);
Collection permits = bundle.getPermits();
List rolesStrings = new ArrayList();
for (Bundle itRole: permits){
String itName = itRole.getName();
rolesStrings.add(itName);
}
return rolesStrings;
}
catch (Exception e){
if (null != bundle && null != bundle.getName()){
return "error getting profiles for " + bundle.getName() + ": " + e.getMessage();
}
else{
return "null role";
}
}
</Source>
</RenderScript>
</ReportColumnConfig>
</Columns>
</LiveReport>
</value>
</entry>
</Map>
</Attributes>
<Description>Displays information about each role in detailed format.</Description>
<RequiredRights>
<Reference class="sailpoint.object.SPRight" name="Roles Report TEST"/>
</RequiredRights>
</TaskDefinition>