Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

1

1 vote

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?


Accepted answer

Permanent link
 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

3 votes

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

Permanent link

Another way could be using the reportable RestAPI.

See https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI


 

0 votes

Comments

 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
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

0 votes

Comments

This still fails in 4.0.6. The parameter is ignored. 


Permanent link
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.

0 votes


Permanent link
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.

0 votes


Permanent link
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

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937

Question asked: May 22 '12, 11:19 a.m.

Question was seen: 10,975 times

Last updated: Jul 15 '15, 5:24 a.m.

Confirmation Cancel Confirm