It's all about the answers!

Ask a question

REST API to create Work Item in RTC


K P (211) | asked Jun 16, 3:39 a.m.

 Hi team,


I am using Postman as a Rest Client and I want to create Work Item in RTC using Rest API. Please help for the same

2 answers



permanent link
Bharath Rao (8207) | answered Jun 16, 5:01 a.m.

 Hello,


I believe the links here answers your question:



permanent link
Ralph Schoon (58.5k23642) | answered Jun 16, 9:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

From there you get what you need. The sequence looks like this:

Catalog (Project Areas)
Request GET https://elm.example.com:9443/ccm/oslc/workitems/catalog
Project Area service descriptor for one project area
Get creation Factory for the type
Resource Shape for the work item type of one project area
Request GET https://elm.example.com:9443/ccm/oslc/context/_8e5qfFpmEeukW7cqqDjAuA/shapes/workitems/
Resource Shape defines available attributes and the allowed values for attributes
Get details for complex values (Category, Target, Enumerations) following the links
Example Category “unassigned” see "dcterms:title": "Unassigned"
Request GET https: //elm.example.com:9443/ccm/resource/itemOid/com.ibm.team.workitem.Category/_8s97oVpmEeukW7cqqDjAuA

Compose the Request body with the attributes needed for the work item and post
Request POST https://elm.example.com:9443/ccm/oslc/contexts/_8e5qfFpmEeukW7cqqDjAuA/workitems/defect
Body:
{"dcterms:title": "Work Item Created from JSON in Python.", "dcterms:description": "This is a work item linking to <a href=\"https://jazz.net/\">Jazz.net</a>.", "rtc_cm:filedAgainst": {"rdf:resource": "https://elm.example.com:9443/ccm/resource/itemOid/com.ibm.team.workitem.Category/_HWNLMFpnEeukW7cqqDjAuA", "rdf:type": [{"rdf:resource": "http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/Category"}]}}

Your answer


Register or to post your answer.