It's all about the answers!

Ask a question

Perl and REST - how to determine Work Item Category?


Cliff Gardiner (92727) | asked Apr 15 '16, 11:21 a.m.
CLM 4.0.7 iFix007 on Win Server 2008 R2 (upgrade to CLM 6.0.1 still some months away, sadly)

Hi all, I'm trying to use the REST API from Perl for automating various tasks, but starting with creating work items.  I have followed numerous docs such as https://jazz.net/library/article/1001 and their links, and can chain along Root Services doc -> CM Service Provider Catalogue -> Service Provider doc with the occasional tangent to get to Project Areas and other docs.  I understand that I need to construct an RDF request mesage and post it to the Work Item Creation Factory URL and I can get the shape of the request message from https://jazz.net/wiki/bin/view/Main/WorkItemAPIsForOSLCCM20#Jazz_Vocabulary.

My problem is that I need to supply the ID for the Work Item Category in that RDF message and I can't find where to get it from

The project areas doc pointed to from the rootservices doc gives links to team areas and timelines but chasing these down doesn't help - I can get to the iteration but can't find a route to WI Categories anywhere.

Can anyone help?

Accepted answer


permanent link
Donald Nong (14.4k314) | answered Apr 18 '16, 2:18 a.m.
This has been asked in the past. The best option I can think of is REST API (as opposed to OSLC API that you're using). But in terms of programming, there is not much difference between them.
https://jazz.net/forum/questions/162770/how-to-programmatically-get-list-of-all-filed-against-values

Note that the resource URI returned by the reportable REST API is different from what you would use in OSLC API, so you need to change it accordingly. For example, you need to change /ccm/rpt/repository/workitem/category/itemId/<itemId> to /ccm/resource/itemOid/com.ibm.team.workitem.Category/<itemId>. Or you simply grab the <itemId> value and append to /ccm/resource/itemOid/com.ibm.team.workitem.Category/.
Cliff Gardiner selected this answer as the correct answer

Comments
Cliff Gardiner commented Apr 18 '16, 7:04 a.m.

Thanks Donald,

it looks like I'll need to use a combination of the two APIs as the OSLC one seems to be the way to go to create/update/delete while REST looks like the choice for simply reporting.

Regards,

Cliff

Your answer


Register or to post your answer.