It's all about the answers!

Ask a question

REST API to view work item in RTC in JSON format


Bijoy J (11) | asked Mar 24 '21, 4:54 a.m.

 I am trying to figure out a way to view work item in JSON format. This is the URL which I am accessing to view the work item : https://localhost:8080/ccm/rpt/repository/workitem/workItem/id/104?fields=workitem/workItem[id=104]/(description|summary|severity|state)


It gives me the response code 302 Found. 

I also tried what they have mentioned here but to no avail. 

Is there a way to get the work item in JSON format.


Comments
Ralph Schoon commented May 06 '22, 1:57 a.m. | edited May 06 '22, 2:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

No, the reportable REST API does not support  Json format as far as I understand.


The supported 

I have learned the hard way that you need to understand which API you are trying to use and what limitations it has. 

Accepted answer


permanent link
Ralph Schoon (61.6k33643) | answered May 06 '22, 1:53 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited May 06 '22, 1:53 a.m.

 Please see https://rsjazz.wordpress.com/2022/02/02/ewm-work-item-oslc-cm-api/ 

Note the headers 

Accept application/json; charset=utf-8
Content Type application/json; charset=utf-8

Ralph Schoon selected this answer as the correct answer

Comments
Ralph Schoon commented May 06 '22, 1:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Note that the original question is about the Reportable REST API which does not support Json format.

One other answer



permanent link
Ralph Schoon (61.6k33643) | answered Mar 24 '21, 10:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 As far as I know, the way to ask for the the format is the Accept header. You can try to use other accept headers such as Accept: application/json or Accept: text/json. 


I don not know if
  • The API you are using supports json at all, 
  • What the legal accept header are for all the APIs


Comments
Bijoy J commented Mar 24 '21, 1:07 p.m.

I tried passing the accept headers but still not proper response 


Peterson dos Santos commented May 05 '22, 6:02 p.m. | edited May 06 '22, 1:51 a.m.

 Hi, 


I would like to know how to get a json work item.

Regards any help


Ralph Schoon commented May 06 '22, 2:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you have a question, ask the question. Do not ask your question on someone a question of someone else.

Your answer


Register or to post your answer.