I am trying retrive email of the user with below code, but email and address are coming as null.in organization i have added email and address in personal and contact info for the user who belongs to ABC group. Please help
Thanks in advance
Akhilesh
import org.bonitasoft.engine.identity.ContactData;
import org.bonitasoft.engine.identity.Group;
import org.bonitasoft.engine.identity.User;
import org.bonitasoft.engine.identity.UserSearchDescriptor;
import org.bonitasoft.engine.search.SearchOptionsBuilder;
import org.bonitasoft.engine.search.SearchResult;
import org.bonitasoft.engine.api.IdentityAPI;
Map<String, String> users = new HashMap<String, String>();
IdentityAPI identityAPI = apiAccessor.getIdentityAPI()
//Get GROUP from path
Group rsa_group = identityAPI.getGroupByPath("/ABC")
SearchOptionsBuilder builder = new SearchOptionsBuilder(0, 100);
builder.filter(UserSearchDescriptor.GROUP_ID, rsa_group.getId());
SearchResult<User> userResults = identityAPI.searchUsers(builder.done());
for (User user : userResults.getResult()) {
ContactData contact = identityAPI.getUserContactData(user.id, true);
users.put(contact.building.toString()+" - "+user.id+" - "+contact.getEmail() +" - "+user.firstName + "- " + user.lastName,user.id);
}