How to retrieve all the defects using OSLC REST API?
I got a requirement to retrieve all the defects irrespective of project areas they are in.
I am trying to access the following URL through browser.
https://localhost:port/ccm/rpt/repository/workitem?fields=workitem/workItem[...]/displayFields&size=500
I am getting 500 error.
Can you please help me with it?
|
3 answers
Hi Amarnathreddy,
I think we can't get work items irrespective of project areas
but,
we can get all project areas from server
and,
we can create a loop for each project area defect items using RTC Plain Java Libs.
Browsers does not always show the correct query result but API shows. If you want to develop an API for it I can help you.
Comments
I appreciate your reply. I have developed a Java module which retrieves/creates Work Items using Plain Java LIB. It is running successfully.
I am planning to replace that with OSLC/REST API because of the following reasons.
There are less than 500 defects. I will be fetching the defects which were created/modified in past one week and it’s hardly around 10 defects. I am sorry! for the self made URL, I am confused after searching for long for the URL in jazz.net. I couldn't get it right.
Can you help me with the following operations getting through OSLC/REST? 1. Filter defects based on custom attribute (my case the custom attribute is 'subtype') across all the project areas (or) 2. Get all the project areas and get the filtered defects from project area based on custom attribute (subtype).
Do you have any a piece of code about jazz oslc api? login server, httputils, etc?
Can you get any oslc query result using jazz oslc api?
Amarnathreddy Kashireddy
commented May 05 '16, 11:59 a.m.
I am able retrieve id|summary from the RTC but I am not really sure how to apply filter for the defects and also filter based on custom attribute (our case 'subtype'). https://localhost/ccm/rpt/repository/workitem?fields=workitem/workItem/(id|summary)
Donald Nong
commented May 05 '16, 11:46 p.m.
Have you checked the examples in the API reference? There are quite a few and you should get a clear idea how it works.
|
The three dots in the square brackets [...] looks quite bizarre. Does the URL that you used really look like this? If true, the syntax is simply wrong, hence the 500 error. I don't know how many attributes you want to retrieve from the work items, but you can start with "?fields=workitem/workItem/id".
Note that retrieving huge volume of data out of the server can put pressure on the server, and even bring it down. Proceed with caution. |
Thanks for helping me through thinking process. I was looking at the link page before. But it started making sense to me while I was going through your answers and google search. I came up with the following URL. Assuming it helps people in future who refers this post. It is working fine for me. I couldn't apply filter on custom attribute (subtype) which is part of allExtentions. But there are multiple allExtentions. Subtype location is "allExtentions/displayName" and it's value location is "allExtentions/displayValue" Let me know if it s possible. Comments
Donald Nong
commented May 09 '16, 12:24 a.m.
Since "allExtentions" is multivalued, it is not possible to apply a filter to it (you will get an error if you try to), unfortunately.
Amarnathreddy Kashireddy
commented May 10 '16, 11:11 a.m.
Thank you for the reply. I finally decided to retrieve all the defects and filter them out in my tool. I wanted to avoid retrieving unwanted defects in the first place but it is not possible. I felt RTC REST API is not matured enough. |
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.