How to get the firstname lastname email of an Identity in SailPoint IIQ?

sailpoint-get-firestname-lastname-in-sailpoint

In this Sailpoint tutorial post, we will learn how to get the firstname, lastname, Email attributes of an Identity in SailPoint IIQ?

import java.util.Map;
import java.util.HashMap;
import sailpoint.api.SailPointContext;
import sailpoint.object.Identity;


public Map getIdentityAttributes(String Identity) {
Map idenAttributeMap=new HashMap();
Identity iden=context.getObjectByName(Identity.class,identity);

//print all attributes of an identity.
//return iden.toXml();

//get FirstName of an Identity
if(iden.getFirstName() !=null) {
idenAttributeMap.put("firstName",iden.getFirstName());
} else {
idenAttributeMap.put("firstName","");
}

//get LastName of an Identity
if(iden.getLastName() !=null) {
idenAttributeMap.put("LastName",iden.getFirstName());
} else {
idenAttributeMap.put("LastName","");
}

//get email of an Identity
if(iden.getEmail() !=null) {
idenAttributeMap.put("firstName",iden.getEmail());
} else {
idenAttributeMap.put("email","");
}
}
//call the method by passing any identity employee id
getIdentityAttributes("123456");

We can get firstName , email from Identity object. In above example, One method is created.Inside method we are getting identity object by passing employeeID. You can see all the attributes of an identity by calling iden.toXml();

FirstName, Lastname, email attributes can be get by using iden.getFirstName() , iden.getLastName() and iden.getEmail().

Scroll to Top