Get status of Link object

Hi all,

How to status of Link object in IIQ through code?

Thanks in advance

Hi @rishavghoshacc,

You can retrieve the status of a Link object using the following code:

import sailpoint.object.Link;

// Get the identity
String identityName = "jdoe";  // Replace with actual identity name
Identity identity = context.getObjectByName(Identity.class, identityName);

if (identity != null) {
    List links = identity.getLinks();
    for (Link link : links) {
        String appName = link.getApplicationName();
        boolean status = link.isDisabled();
        System.out.println("Application: " + appName + " | Status: " + status);
    }
} else {
    System.out.println("Identity not found.");
}

Let me know if you need more details! :rocket:

Hi @rishavghoshacc,

Just checking in to see if my response helped you.

If this solution resolved your issue, could you mark it as the accepted answer in the forum? This would help others facing similar challenges and also allow me to continue progressing on my journey as a SailPoint Ambassador.

Let me know if you need further assistance!