IIQ version 8.3p2
My Question-
Is there an easy way to call the Identity Refresh on a user when they are added to a role so that role and the required roles are provisioned right away? I’m just using a basic Match List and not a script.
Screenshot of my role
I tried to use a script for the assignment rule and include ‘identityService.refreshIdentity’ but I’m not sure if this will work.
import sailpoint.api.SailPointContext;
import sailpoint.object.Identity;
import sailpoint.object.RoleAssignment;
import sailpoint.object.Filter;
import sailpoint.object.QueryOptions;
import sailpoint.api.IdnetityService;
import sailpoint.tools.GeneralException;
import java.util.List;
public class BusinessRoleAssignmentRule{
public static void main(String[] args) throws GeneralException {
SailPointContext context = SailPointFactory.getCurrentContext();
String adGroup = "CN=MyExampleGroup";
String tonyBusinessRole = "Tony Business Role";
Filter filter = Filter.eq("memberOf", adGroup);
QueryOptions queryOptions = new QueryOptions();
queryOptions.addFilter(filter);
List<Identity> identities = context.getObjects(Identity.class,queryOptions);
for (Identity identity : identities){
RoleAssignment roleAssignment = new RoleAssignment;
roleAssignment.setIdentity(identity);
roleAssignment.setRole(context.getObjectByName(Role.class, tonyBusinessRole));
identity.addRoleAssignment(roleAssignment);
context.saveObject(identity);
IdentityService identityService = new IdentityService(context);
identityService.refreshIdentity(identity.getID());
}
}
}