It's all about the answers!

Ask a question

EWM ELO PUB 7.0.2 - Publish work item categories as a heiarchical list


Glyn Costello (13632) | asked Nov 20 '23, 11:46 a.m.
 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


permanent link
Davyd Norris (2.1k217) | answered Nov 20 '23, 7:04 p.m.
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
Glyn Costello selected this answer as the correct answer

One other answer



permanent link
Ralph Schoon (62.9k33645) | answered Nov 20 '23, 2:03 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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. 

Your answer


Register or to post your answer.