How to get the llist of all users in JTS via REST
Hi,
This (or similar) question appears to have been asked before but there doesn't seem to be any satisfactory answer.
I am writing a program to bulk manipulate user membership/roles within project and team areas. I need to be able to check if the users already exist in CLM.
It is possible to check each user id by check result of "https://localhost:9443/jts/users/xxx" but this is tedious (and the URL may change in future?) (REST says only ever get resource url by getting from the attribute?)
So ideally, I retrieve list of all users and user-url from jts and use hash to check user.
I tried to get the list of users via (accept:application/rdf+xml and oslc-core-version:2.0) https://localhost:9443/jts/rootservices -> <jfs:users rdf:resource="https://localhost:9443/jts/users" />
But I get: a 405
- Status Code: 405 Method Not Allowed
- x-powered-by: Servlet/3.0
- x-com-ibm-team-scenario: 9.145.184.217
- Content-Type: text/html;charset=UTF-8
- Content-Language: en-US
- Transfer-Encoding: chunked
- Connection: Close
- Date: Mon, 05 Feb 2018 12:06:48 GMT
accepting xml, rdf, rdf+xml produce same result.
One answer
There are a number of similar posts over forum which may help you:
https://jazz.net/forum/questions/223363/using-the-rest-api-how-would-i-find-all-rtc-projects-all-users-on-each-rtc-project-and-all-the-user-roles-including-admin-for-each-user-on-each-rtc-project
https://jazz.net/forum/questions/109593/oslc-user-list
https://jazz.net/forum/questions/112154/get-list-of-users-rest
Comments
OK, I see that nothing will return a list of all users with id, name and user-url.
I need to manipulate (
oops...
I need to manipulate user role assignments etc (see https://jazz.net/library/article/633, and https://jazz.net/wiki/bin/view/Main/DraftTeamProcessRestApi), I would much rather get the user-url from CLM REST (and no, using jazz api is not an option, since it works only for ccm and I need it to work for ccm, rm and qm).
I suppose I have to manufacture the user url myself.
It is strange that there are solutions for problems using information that is not obtainable using same mechanism.
Anyway, thanks for all your effort.
The basic User, Project Area API is the same for RTC, RM, QM, JTS:
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Feb 05 '18, 7:43 a.m.I don't know what service you need, but "https://localhost:9443/jts/users" does not seem to be designed to return a list of users. If you leave out the user ID e.g. admin in the example, "https://localhost:9443/jts/users/admin"the service tells you that this call is not allowed. This indicates your assumption of using it that way is incorrect.
Lewis Tsao
Feb 05 '18, 7:46 a.m.Thanks Ralph.
Perhaps a more to the point question
is there any way of return the full list of users in CLM to include "userid", "user name" and "user-url" using REST.