EWM ELO PUB 7.0.2 - Publish work item categories as a heiarchical list
Hi,
If I have a structured set of work item categories... i.e.
- Cat a
- Cat a1
- Cat a2
- Cat b
- Cat b1
- Cat b2
Is there a way I can iterate through these through the Reportable REST API and publish the work items which are listed against the category?
i.e.
- Cat a
- Cat a1
- WI 1
- Cat a2
- WI 2
- WI 3
- Cat b
- Cat b1
- WI 4
- Cat b2
- WI 5
- WI 6
The REST API documentation in Jazz only lists the "Category" as an atribute of a work tiem query, and doesn't appear to be queriable independently?
I'm aware I can query Work Items against known category values, I'm asking more that the initial query is to get the list of "Categories" available in the repository/project area.
Thanks,
Glyn
Accepted answer
If you use the workitem end point in the Reportable REST API, one of the top levels is category. This will give you all the Categories in all the project areas, and you can filter this using the native filter for the project area you want.
Once you have this, the qualifiedName property gives you the full hierarchy of the Category, separated by a '/', so you can parse this to pull out each level of the hierarchy.
You can then use these values in the native filter for the work items themselves by using the form /workitem/workitem/category/qualifiedName.
Alternatively you could iterate through the whole list or work items and use the property above to store them in an array before printing
One other answer
Hi Glyn,
I am not sure if you can get all values using the Reportable REST API https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI#category_type_com_ibm_team_worki . It might only be available as attribute value. But I am reasonable sure, you can discover the OSLC Resource shapes for work items in the EWM OSLC API ( https://rsjazz.wordpress.com/2022/02/02/ewm-work-item-oslc-cm-api/ ). The resource shape has a link to the available values for each attribute, where you should be able to get all category values.