It's all about the answers!

Ask a question

retrieving Code Review details from a work item (via curl)


ken teo (11) | asked Apr 09, 12:40 p.m.
i am trying to get the list of file changed for this workitem and on the web, code review has the file path/file name

curl.exe -k -b %COOKIES% https://%HOST%/ccm/oslc/workitems/15511.json -o workitem.txt

"rtc_cm:com.ibm.team.filesystem.reviews.linktype.codereview.com.ibm.team.filesystem.reviews.link.codereview": [
    {
      "oslc_cm:label": "Code Review: task 15511-xxxxx",
      "rdf:resource": https://xxxxx/ccm/resource/itemOid/com.ibm.team.filesystem.reviews.CodeReview/_jjS3IMaseq6q59XhV14xnw
    }
  ]
  curl -k -L -b %COOKIES% https://%HOST%/ccm/resource/itemOid/com.ibm.team.filesystem.reviews.CodeReview/_jjS3IMaseq6q59XhV14xnw -o codereview.txt

For the last part, i can't extract any media type from the codereview link. Either i get a html redirect page or a error indicating content is not serializable. Getting info via changeset doesn't give me the file path.

Anyone can help? i want to retrieve the list of file changes (with its path) of a particular workitem.

Comments
Michael Rowe commented Apr 09, 1:19 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR

How are you addressing Authentication? Also, I don't believe that is a Public Rest API.  Please review the APIs supported by EWM via the ELM API Landing Page


ken teo commented Apr 10, 11:05 a.m.

its batch, so i am using the form based auth using curl.

I have been looking through the APIs but no luck yet, seems like there is no possible way to get the code review info via rest api alone.


Ralph Schoon commented Apr 11, 2:01 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

"its batch, so i am using the form based auth using curl.


Makes no sense, the authentication is defined by the server, not the client. See: https://rsjazz.wordpress.com/2021/10/15/elm-authentication/ . You have to check the headers and response code. Form auth only works if the system is installed to use it.

JSON is not really supported by a lot of the EWM API.

One answer



permanent link
Ralph Schoon (63.5k33646) | answered Apr 10, 2:18 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

See the link below. These are the APIS for code review that are available. I can not comment David's remarks on which APIS are public. In general, APIS that are not listed in ELM API Landing Page or some other official location it is considered internal API and is not supported. Note you can do things wrong with internal APIs. 

https://jazz.net/forum/questions/263396/is-there-a-specific-api-that-can-call-up-code-review-summary-data


Note that for some of the API's media types like JSON might not be supported or only partial supported. There are media types such as application/rdf+xml and others.


Comments
ken teo commented Apr 10, 11:13 a.m.

if i understand correctly what david suggested, was to use SCM CLI (1) to create a code review report. Then (2) rest service to query that report. And finally (3) is using SDK. My objective was to do everything via rest api if possible. Otherwise using the SDK would be the next only option left?


Ralph Schoon commented Apr 11, 2:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I am not aware of a public REST API for reviews. I have not yet tried the SDK for code review. I can only point out what is on this forum. 


ken teo commented Apr 15, 9:50 a.m.

Thanks for replying. One last check, is there any known workable method that you know of to get the code review details? besides from the web. Even via the eclipse rtc client, it's just a link to open the web code review.


Ralph Schoon commented Apr 18, 4:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If I was aware of how this could be achieved, I would have told you. So the only options you have, as I see it, is to look into the APIs that are available and try to figure if there is a way. I doubt it. 

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.