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.
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".
Comments
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. 1 vote
5 other answers
Another way could be using the reportable RestAPI.
See https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI
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
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
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.
Comments
Karthik Krishnan
Jul 04 '12, 11:34 a.m.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
Dax Haslam
Nov 06 '12, 7:26 p.m.Did anyone find a way around this?