It's all about the answers!

Ask a question

How to get the llist of all users in JTS via REST


Lewis Tsao (2174963) | asked Feb 05 '18, 7:10 a.m.

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

  1. Status Code: 405 Method Not Allowed
  2. x-powered-by: Servlet/3.0
  3. x-com-ibm-team-scenario: 9.145.184.217
  4. Content-Type: text/html;charset=UTF-8
  5. Content-Language: en-US
  6. Transfer-Encoding: chunked
  7. Connection: Close
  8. Date: Mon, 05 Feb 2018 12:06:48 GMT

accepting xml, rdf, rdf+xml produce same result.




Comments
Ralph Schoon commented Feb 05 '18, 7:41 a.m. | edited Feb 05 '18, 7:43 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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 commented 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.

One answer



permanent link
Don Yang (7.7k21114139) | answered Feb 05 '18, 6:15 p.m.

Comments
Lewis Tsao commented Feb 05 '18, 7:41 p.m.

OK, I see that nothing will return a list of all users with id, name and user-url.
I need to manipulate (


Lewis Tsao commented Feb 05 '18, 7:46 p.m.

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.


Ralph Schoon commented Feb 06 '18, 2:12 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The basic User, Project Area API is the same for RTC, RM, QM, JTS:

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.