Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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.

0 votes

Comments

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

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.

"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

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.

0 votes

Comments

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?

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. 

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.

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019
× 479

Question asked: Apr 09, 12:40 p.m.

Question was seen: 719 times

Last updated: Apr 18, 4:30 a.m.

Confirmation Cancel Confirm