RTC REST or OSCL API : how to archive a user / contributor ?
![]() I would like to know how I can programmaticly archive a user in RTC by calling a REST API or OSLC API |
Accepted answer
![]()
Ralph Schoon (63.3k●3●36●46)
| answered Jun 28 '21, 6:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER If there is no REST API for this, the Plain Java Client Libraries are available and can modify users.
See:
Olivier ROSET selected this answer as the correct answer
Comments 1
Yep.
Done by using the Java api. IContributor class have a setArchived(boolean arg) method very usefull for the job. Thanks.
Yep.
|
3 other answers
![]()
David Honey (1.8k●1●7)
| answered Jun 21 '21, 5:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Jun 21 '21, 5:38 a.m. You can find documentation on the foundation users API referenced from
235240: JFS Users API doc. Specifically, https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.Attachment/117381.
You can query for users using a GET on contextRoot/users?query=query
The syntax of the query is described in https://jazz.net/wiki/bin/view/Main/JFSApplicationQueryLib#Query_Syntax
The syntax seems similar to OSLC query, but the API is not an OSLC query capability.
For example, you might use a query string (unencoded) of foaf:name="Firstname Lastname" or foaf:mbox="user@domainname.com". Remember that query parameters should be URL encoded. For example: GET https://jazz.net/jazz/users?query=foaf%3Aname%3D%22Firstname%20Lastname%22
The response is an atom feed with mime type
application/atom+xml
Comments
Thanks for the answer. That can help. But, the first 2 links are not available to average users. :) I can't read them.
I got a error message after my loggin on the web site when I try to read those links :
Error!
You may not have rights to access the item
![]() FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Olivier,
Sorry about that. The work item and its attachment are in a private project area. I think there's some concern that the user data might be sensitive. Having said that, there is a people picker in the UI that a user can use to find out names and email addresses of other users in that JTS.
Try the query example in my earlier comment. It worked for me.
Another possibility is to query for users in Lifecycle Query Engine. If you have a federated deployment, that can give you details of users across all the JTSs that are being indexed.
You can also try looking at the history of the Wiki page: https://jazz.net/wiki/bin/rdiff/Main/JFSUsersAPI?type=history. Not sure if you have access to that.
|
![]()
David Honey (1.8k●1●7)
| answered Jun 11 '21, 8:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Have you tried a GET followed by a PUT?
For example: GET <userUri> with Accept=application/rdf+xml
This might provide:
Change the jfs:archived property to true, then perform a PUT.
Try that. Comments He probably does not know how to discover the base URI to find users etc. David. It is not obvious. Yep. Good guess. :) How can I get the base URI for a particular user ? Don't forget to get the etag returned in the GET response header and put it in the PUT call header ! Precision : The PUT or PATCH methods are not supported by this url.
Calling it with PUT give you a answer like this :
Error 405: HTTP method PUT is not supported by this URL
If you call it with OPTIONS instead of GET, you get a response like this in the header:
allow: GET, HEAD, POST, TRACE, OPTIONS :
Any other id for changing a attribute by the OSLC RESP API ?
The original documentation on the Wiki says:
So it looks like there is no public REST API to support modifying JTS users.
|
![]()
Ralph Schoon (63.3k●3●36●46)
| answered Jun 21 '21, 5:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER I have searched this forum and find the users API confusing.
The CCM Rootservices.xml lists
<jfs:users
rdf:resource="https://elm.example.com:9443/jts/users" />
This returns 405 if called. You can call it using https://elm.example.com:9443/jts/users/<userID> and then you get the user and can modify it. (header only accept required, I used application/rdf+xml)
I can get the users by calling https://elm.example.com:9443/ccm/oslc/users with an accept header like above and header OSLC-Core-Version 2.0. This provides me with the JTS links for all the users. I wonder where I could discover this information.
The reportable rest is also listed in several examples to allow getting the users, especially in the context of project areas.
|
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.