Retrieving list of categories for a given project via OSLC
I am attempting to create a work item using OSLC. In order to identify the category to file against, I am able to use the following request to retrieve ALL categories (across projects):
https://appserver.ibm.com:19443/ccm/oslc/categories This works fine in v3.0.1.3 and v4.0 RC4a. I would rather retrieve just those for a particular project area. I attempted the following URL: https://appserver.ibm.com:19443/ccm/oslc/categories?oslc.select=rtc_cm:projectArea,dcterms:title,rtc_cm:hierarchicalName&oslc.where=rtc_cm:projectArea="_kvL7cKQdEeG8FJTW-G_Mfg" It works fine in v3.0.1.3. However, in v4.0 RC4a (I originally observed this error in v4.0 RC1a), I get the following error: Illegal argument 'Project Area': _kvL7cKQdEeG8FJTW-G_Mfg with a oslc:statusCode of 400 Is there another way to retrieve categories in a given project area? Thanks, Prem. |
Accepted answer
FOUND THE ANSWER:
https://SERVER:PORT/jazz/oslc/categories.xml?oslc_cm.query=rtc_cm:projectArea="PROJECTID"
Note that you may need to replace "jazz" with "ccm".
Thatta Premnath selected this answer as the correct answer
Comments 1
I can successfully pull all of the categories for the "Rational Team Concert" project area out of jazz.net with https://jazz.net/jazz/oslc/categories.xml?oslc_cm.query=rtc_cm:projectArea="_1w8aQEmJEduIY7C8B09Hyw" I determined the project area ID by going to the project area web UI and getting the item id from the URI. I need to specify Accept: application/json in the request headers, otherwise I get an HTTP 406. |
5 other answers
Another way could be using the reportable RestAPI. See https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI
Comments
Mike Shkolnik
commented May 15 '14, 6:18 p.m.
The link you provided shows how to use Category to filter a list of work items. It does not show how to get a list of categories. |
Querying on the nested property name of dcterms:title of the Project Area, this worked for me on 4.0.3:
Request Headers: OSLC-Core-Version=2.0 Content-Type=text/xml Accept=application/xml (Although text/xml, text,json also work as expected) GET: https://localhost:9443/jazz/oslc/categories?oslc.select=dcterms:title&oslc.where=rtc_cm:projectArea{dcterms:title="The Project Name"} With reference to: http://open-services.net/bin/view/Main/OSLCCoreSpecQuery Comments
Mike Shkolnik
commented May 15 '14, 6:22 p.m.
This still fails in 4.0.6. The parameter is ignored. |
This appears to still fail. Has anyone found a way to do this? The parameter is ignored and the full list of categories is the result.
|
For RTC 4.0.6, the correct request is
https://<server>:<port>/ccm/oslc/categories?oslc.where=rtc_cm:projectArea="https://<server>:<port>/ccm/oslc/projectareas/<projectId>"Basically, you can GET a category first and find out which attribute is for the project area and what the value looks like, then construct the "oslc.where" bit accordingly. |
HI All,
The above url still fetching all categories of Jazz server, not for a particular project area. Is there anything changed? I am using RTC 5.0.2. Thanks, Sud |
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.
Comments
Same here. Works fine in 3.0.1 and fails in RTC 4.0 GA. I either get 400 or 500 error. Wondering what has changed. No information yet on this
Did anyone find a way around this?