It's all about the answers!

Ask a question

Retrieving list of categories for a given project via OSLC


1
1
Thatta Premnath (1812) | asked May 22 '12, 11:19 a.m.
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.

Comments
Karthik Krishnan commented 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 commented Nov 06 '12, 7:26 p.m.

Did anyone find a way around this?

Accepted answer


permanent link
Mike Shkolnik (9406121143) | answered May 15 '14, 6:35 p.m.
 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
Evan Hughes commented Mar 14 '15, 8:29 p.m. | edited Mar 14 '15, 9:53 p.m.
JAZZ DEVELOPER

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



permanent link
Guido Schneider (3.1k137193) | answered Jul 04 '12, 1:18 p.m.

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.


permanent link
Paul Romanus (3345) | answered Nov 29 '13, 5:53 a.m.
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. 


permanent link
Mike Shkolnik (9406121143) | answered May 15 '14, 6:19 p.m.
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.

permanent link
Donald Nong (12.1k29) | answered Jun 03 '14, 9:16 p.m.
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.

permanent link
Sudipto Sarkar (6517) | answered Jul 15 '15, 5:24 a.m.
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


Register or to post your answer.