It's all about the answers!

Ask a question

RAM API to retrieve the users assigned to a particular User role?


Sripriya Karimpuzhasriram (134752) | asked Apr 30 '13, 6:53 a.m.
converted Apr 30 '13, 3:16 p.m.

Hello team,

We are looking for an API that will retrieve all the users who are assigned to a  User role in a community.

We tried the getUserIDs() RAM API but it gives null pointer exception error. We are using RAM 7.5.0.2. Please advise?

Snippet code

------------------

 try
  {
  RAMSession session = new RAMSession( "RAMURL", "ADMIN", "PASSWORD" );
  RAMCommunity community = session.getCommunity("COMMUNITY NAME");
  // Connect ram server
  RAM1 ram1 = new RAMClient(new URL( "RAMURL" ), "ADMIN", "PASSWORD", null).getRAM1Webservice();
  //Get User Roles for this community
  RoleSO[] rolesArray = ram1.getRoles(community.getId());
  //Get User IDs for each role
  for(int i=0; i<rolesArray.length; i++){

 System.out.println("Role Name: " + rolesArray[i].getName() + "     Number of Users: " + rolesArray[i].getUserIDs().length);
  }
  session.release();
  }
  catch(Exception e){e.printStackTrace();}

Thanks in advance,

Regards,

Sripriya

One answer



permanent link
Rich Kulp (3.6k38) | answered Apr 30 '13, 6:08 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Please do not use the new RAMClient directly. That is an entirely internal class and is not supported as API. Any methods on it at any release of RAM may become non-functional or even removed. That particular method isn't even used anymore so it has not been kept up to date.

That information isn't sent through any of the web/webservices/rest calls.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.