idn.getAccountAttribute syntax for Identity attribute rule

Hi,Want to read the accountID attribute of the source for Identity attribute calculation The below syntax would work,Please share inputs for below syntax
idn.getAccountAttribute(“sourcename[source]”, accountID ,“accountID”);

HI @SrideviJaya,

can you try below code

import java.util.ArrayList;
import java.util.List;
import connector.common.Util;
import sailpoint.object.Identity;
import sailpoint.object.Link;
import sailpoint.server.IdnRuleUtil;


String nativeIdentity = null;
String values = null;
String applicationName = "";

List links = identity.getLinksByAppIdOrName(null, applicationName);
if (null != links && !links.isEmpty()) {
	for (Object link: Util.safeIterable(links)) {
		Link account = (Link) link;
		nativeIdentity = account.getNativeIdentity();
		values = idn.getAccountAttribute(applicationName, nativeIdentity, "accountID");
	}
}

Hope it helps, Let me know how it goes

Thank you.

2 Likes

Thanks will check is there any way to test this locally before sending to sailpoint team for cloud rule deployment

@SrideviJaya, you can try using sailpoint RDK (Rule development kit) for testing the rules before sending for deployment.

1 Like

Thanks , but how do we validate the sourcename in the tenant
locally and can native identity be any identity attribute

The application/source name can be used, for example, Active Directory[source]. Use it according to your source name, and the nativeIdentity will be the attribute set as accountId in the account schema

1 Like

The syntax worked thanks

Feel free to mark it as solution

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