How to set entitlement owner from manager in group aggregation rule of servicenow connector

how to set entitlement owner from manager in group aggregation rule in servicenow connector

Do you want to set Entitlement owner at the time on Group Aggregation? can you please elaborate the requirement more?

Hi @YanamalaNavaneetha ,

Welcome to SailPoint Development Community!!

Please find a sample group refresh rule which will fetch the owner from the resourceObject and set it as Entitlement owner. You can use it according to your requirement.

  List ownerList = (List) obj.getAttribute("owners");
  String owner = (String) ownerList.get(0);
  QueryOptions options = new QueryOptions();
  options.addFilter(Filter.eq("displayName", owner));
  Iterator iterator = context.search(Identity.class, options);
  if (iterator != null) {
    if (iterator.hasNext()) {
      Identity ownerIdentity = (Identity) iterator.next();
      if (ownerIdentity != null) {
        accountGroup.setOwner(ownerIdentity);
      }
    }
  }

Also, can you be more specific on your requirement? So that we can help you accordingly

To set the manager (attribute of group object in ServiceNow) as the owner of the entitlement, you can use a Customization rule for the group:

This gets the ‘manager’-attribute value from ServiceNow (during group aggregation), searches for the Identity object of the manager, and if found set it as owner (if not found set the owner to ‘spadmin’).

Here the code I used (copy/pastable):

import sailpoint.object.Identity;
import sailpoint.tools.Util;

String managerName = (String) obj.getAttribute("manager");
if (Util.isnotNullOrEmpty(managerName)) : 
  Identity manager = context.getUniqueObject(Identity.class,managerName);
  if (manager == null) {
    manager = context.getUniqueObject(Identity.class,"spadmin");
  }
  object.setOwner(manager);
}
return object;

– Remold

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.