It's all about the answers!

Ask a question

REST API to create Work Item in RTC


KT PD (597) | asked Jun 16 '21, 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
Ralph Schoon (63.1k33646) | answered Jun 16 '21, 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"}]}}


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

 Hello,


I believe the links here answers your question:


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.