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?
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) 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. |
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.