Getting a category ID list through the RTC REST API
In order to do queries filtered on category, I need to know the category ID (the long string of characters looking something like "_hDbz8EqVEd6HXO10niqZpg")
The API instructions here:
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2
Include the example:
So how do I get a list of all those category IDs?
I know how to get the Project IDs:
https://:9443/jazz/oslc/workitems/catalog
Is there a similar catalog of Category IDs within a project?
The API instructions here:
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2
Include the example:
Work Items in category 'X' ordered by Id
rtc_cm:filedAgainst="https://localhost:9443/jazz/resource/itemOid/com.ibm.team.workitem.Category/_hDbz8EqVEd6HXO10niqZpg" /sort=dc:identifier
rtc_cm:filedAgainst="_hDbz8EqVEd6HXO10niqZpg" /sort=dc:identifier
So how do I get a list of all those category IDs?
I know how to get the Project IDs:
https://:9443/jazz/oslc/workitems/catalog
Is there a similar catalog of Category IDs within a project?
6 answers
Error message:
"The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers ()."
I would think I need to include the project ID, so I think something may be missing from this syntax.
"The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers ()."
I would think I need to include the project ID, so I think something may be missing from this syntax.
Now this is strange.
I have just tried browsing to "https://<server>:9443/ccm/oslc/categories" on my 3.0.1 test server, and no error occurs. The server correctly answers with an XML document containing a collection of categories.
Anyway, to include the project ID, try this:
https://<server>:9443/ccm/oslc/categories?oslc_cm.query=dc:title="projectname"
This should return the categories of the "projectname" project. Beware, you may need to URL encode the query before sending it.
-Nicolas
I have just tried browsing to "https://<server>:9443/ccm/oslc/categories" on my 3.0.1 test server, and no error occurs. The server correctly answers with an XML document containing a collection of categories.
Anyway, to include the project ID, try this:
https://<server>:9443/ccm/oslc/categories?oslc_cm.query=dc:title="projectname"
This should return the categories of the "projectname" project. Beware, you may need to URL encode the query before sending it.
-Nicolas
Comments
https://<server>:9443/ccm/oslc/categories?oslc_cm.query=dc:title="projectname" will not filter based on project area name. It will query for the component name.
To filter based on the project area you need to use rtc_cm:projectArea="<project oslc uri>" query.
" https://<server>:9443/ccm/oslc/categories?oslc_cm.query=dc:title="projectname" will not filter based on project area name. It will query for the component name.
To filter based on the project area you need to use rtc_cm:projectArea="<project oslc uri>" query.
"
The <project oslc uri> is the itemId of the project in projetArea artefact.