It's all about the answers!

Ask a question

Getting a category ID list through the RTC REST API


0
1
Mike Shkolnik (9809161143) | asked Oct 03 '11, 8:10 p.m.
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:

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



permanent link
Nicolas Constans (22723) | answered Oct 06 '11, 3:49 a.m.
JAZZ DEVELOPER
Hi,

the catalog of Category IDs within a project is published at:

https://:9443/jazz/oslc/categories


-Nicolas

permanent link
Mike Shkolnik (9809161143) | answered Oct 06 '11, 2:31 p.m.
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.

permanent link
Nicolas Constans (22723) | answered Oct 07 '11, 4:36 a.m.
JAZZ DEVELOPER
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

Comments
Aradhya K commented Jan 17 '14, 4:57 a.m.
JAZZ DEVELOPER

 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.


permanent link
Mike Shkolnik (9809161143) | answered Oct 07 '11, 1:20 p.m.
I don't know if it makes a difference, but I am on 2.0.0.2 ifix5.

I tried your link of &quot;https://&lt;server&gt;:9443/ccm/oslc/categories&quot; and that results in a 404 error (yes, I did change the server name). I think the ccm is dependent on how your server is setup.

permanent link
Mike Shkolnik (9809161143) | answered Oct 13 '11, 9:04 p.m.
Figured it out. The following works:

https://:9443/jazz/oslc/categories.xml

Thanks, you got me most of the way there. :)

permanent link
Olivier ROSET (50221) | answered Jan 16 '18, 8:30 a.m.

 Aradhya K

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.

Your answer


Register or 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.