How to get the roles of specific application in SailPoint

In this post, we will see how we can get the roles of Identity on any specific application. e.g. if an Identity has roles on 10 applications, then we can also see the roles of identity on any particular application.

To get the roles of identity on the particular application we can use the below code.

  import java.util.*;
  import sailpoint.object.*;

  Identity iden = (Identity) context.getObjectByName(Identity.class,"Mary.Johnson"); 
  Application app = (Application) context.getObjectByName(Application.class,"TRAKK"); 
  return iden.getBundles(app);

getBundles(Application application) method will take the application as a parameter.