It's all about the answers!

Ask a question

How to get jts user license details using OSLC/ plain java API?


Anurag Patel (215) | asked Jun 20 '18, 5:03 a.m.

 Hi all,


I need to fetch all user details of CCM along with their email address, roles, license etc. Is it possible using OSLC or Java api? If yes please provide hint. Because as per my knowledge we can not query to JTS using OSLC

One answer



permanent link
Ralph Schoon (55.5k23642) | answered Jun 20 '18, 7:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

You can use the repotools exportUser command for that. You can use the JAVA API e.g. https://rsjazz.wordpress.com/2017/03/29/managing-contributor-licenses-using-the-plain-java-client-libraries/ and other posts on that blog.

There is no OSLC mechanism as OSLC does not cover this. There are Web based APIs to do this however.



Comments
Anurag Patel commented Jun 21 '18, 12:32 a.m.
Thanks @Ralph Schoon for your reply. My requirement is I want to export 

User name, email address, ALM application name,assigned licenses, team area(s), assigned role. What is the feasible way to export all this data in single code? Please provide suggestion. I have option plain java api, OSLC. Is there any other possibility 


Ralph Schoon commented Jun 21 '18, 1:32 a.m. | edited Jun 21 '18, 1:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

My requirement is the answers I give to be read. The time spent on the answer is not free.
Again, you can

  1. Use repotools-jts exportUsers
  2. Use the plain Java Client Libraries see https://rsjazz.wordpress.com/2017/03/29/managing-contributor-licenses-using-the-plain-java-client-libraries/ for a code sample.



Anurag Patel commented Jun 21 '18, 4:36 a.m.

Hi @Ralph Schoon thanks for your valuable time and support. I dont want to use reptool I started working on plain Java Api, suppose one user belongs to multiple applications i.e. ccm ,rqm, dng. Then is it possible to find user details along with its application which he is subscribed for? 


Ralph Schoon commented Jun 21 '18, 11:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Java API is only available for RTC. It has worked in the past for RQM and RDNG I think, but there is no guarantee. The other link provides a good entry point with available code for RTC.


Anurag Patel commented Jun 26 '18, 8:46 a.m.

 @Ralph Schoon ...I tried your code snippet for get license details. But it shows all the license available in application. Is it possible to get license according to user basis. I want to  fetch information of users which he has assigned license


Anurag Patel commented Jun 26 '18, 8:50 a.m.

  @Ralph Schoon ...I tried your code snippet for get license details. But it shows all the license available in application. Is it possible to get license according to user basis. I want to  fetch information of users which he has assigned license


Ralph Schoon commented Jun 26 '18, 10:31 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Sorry, that is what I have at the moment. It is certainly possible to query the system for a user ID ant the users licenses, using  com.ibm.team.repository.common.model.query.BaseLicenseAssignmentQueryModel.LicenseAssignmentQueryModel
but I have no simple example to share.


Anurag Patel commented Jun 27 '18, 4:18 a.m.

 @Ralph Schoon ... Following code I wrote for fetch user license details but code is throwing "null pointer exception" I also tried "getServiceInterface()" method also: I tried below code for client side plugin: Your suggestion is very valuable for me:

TeamRepository repo2 = (TeamRepository) repo;
IContributorLicenseType client = (IContributorLicenseType) repo2.getClientLibrary(IContributorLicenseType.class);
System.out.println("****Licenense***");
System.out.println("Licenense name :"+client.getDescription());

showing 5 of 8 show 3 more comments

Your answer


Register or to post your answer.