Please share any images or screenshots, if relevant.
[Please insert images here, otherwise delete this section]
Please share any other relevant files that may be required (for example, logs).
[Please insert files here, otherwise delete this section]
Share all details about your problem, including any error messages you may have received.
I have requirement to return 1 if any user having business role and that Business role contains IT role else return 0. Also there is one more column need to populate that if user have any entitlment/group return 1 if that entitlement granted by role else return 0
There is no error, Output is not correct for column “Business role have IT role” and “Entitlement granted by role or not”. If you could check the report maybe I am missing something
Thank you for your help!
The output for “businessRoleHaveITRole” is still not as expected—I’m encountering a cast exception when trying to populate the column for “Entitlement granted by role or not.”
However, I found a working solution for this column using the following configuration:
<ReportColumnConfig field=“Entitlement granted by role or not”
header="Entitlement granted by role or not"
property="identityEntitlement.grantedByRole"
sortable="true"
width="110"/>
This returns the expected behavior
Similarly, I’d like to retrieve values for “Assigned Role Sources” and “Detected Role Sources.” I’ve also attached a screenshot of the user profile for reference. You can see that if a user has only an IT Role, the Detected Role Sources field is populated, and if the user doesn’t have a Business Role, it shows NONE.
I’m not sure where these values originate from internally. Could you please help me populate these fields into separate columns in the report? This will help us achieve goal.
Granted by Role is a Boolean value in Entitlements. Where granted by a true suggests, the access is assigned by Sailpoint or via business role, while false suggest, the access is assigned not via an business role.
Can you add below these 2 columns in your report and try and see if it works. if needed modify it. I just wrote it , if there are any syntax minor issues, correct it.
If your issues is resolved, please mark it as solution , It will help others as well.
<ReportColumnConfig field="assignedRoleSources" header="Assigned Role Sources" property="identity" sortable="true" width="110">
<RenderScript>
<Source>
import sailpoint.object.Identity;
import sailpoint.object.Bundle;
import java.util.List;
import java.util.ArrayList;
// 'value' is the Identity because the column property is "identity"
Identity identity = (Identity) value;
if (identity == null) {
return "None";
}
// Get all assigned roles for the identity
List assignedRoles = identity.getAssignedRoles();
if (assignedRoles == null || assignedRoles.isEmpty()) {
return "None";
}
List businessRoleNames = new ArrayList();
// Check each assigned role for business roles
for (Object roleObj : assignedRoles) {
if (!(roleObj instanceof Bundle)) continue;
Bundle role = (Bundle) roleObj;
// Check if this is a business role
String roleType = role.getType();
String roleName = role.getName();
boolean isBusinessRole = (roleType != null && "business".equalsIgnoreCase(roleType));
if (isBusinessRole) {
businessRoleNames.add(roleName);
}
}
if (businessRoleNames.isEmpty()) {
return "None";
} else {
return String.join(", ", businessRoleNames);
}
</Source>
</RenderScript>
</ReportColumnConfig>
<ReportColumnConfig field="detectedRoleSources" header="Detected Role Sources" property="identity" sortable="true" width="110">
<RenderScript>
<Source>
import sailpoint.object.Identity;
import sailpoint.object.Bundle;
import java.util.List;
import java.util.ArrayList;
// 'value' is the Identity because the column property is "identity"
Identity identity = (Identity) value;
if (identity == null) {
return "None";
}
// Get all detected roles for the identity
List detectedRoles = identity.getDetectedRoles();
if (detectedRoles == null || detectedRoles.isEmpty()) {
return "None";
}
List itRoleNames = new ArrayList();
// Check each detected role for IT roles
for (Object roleObj : detectedRoles) {
if (!(roleObj instanceof Bundle)) continue;
Bundle role = (Bundle) roleObj;
// Check if this is an IT role
String roleType = role.getType();
String roleName = role.getName();
boolean isItRole = (roleType != null && "it".equalsIgnoreCase(roleType));
if (isItRole) {
itRoleNames.add(roleName);
}
}
if (itRoleNames.isEmpty()) {
return "None";
} else {
return String.join(", ", itRoleNames);
}
</Source>
</RenderScript>
</ReportColumnConfig>
just checking, if the updated code which i shared to add new columns worked for you. If the issue is fixed, you can mark it as solution, as it will be helpful for others.