It's all about the answers!

Ask a question

How do you specify work item type when creating a draft using REST API?


Lori Ruffing (1738) | asked Sep 15 '16, 1:35 p.m.
 I am trying to specify that a "task" workitem type be created when I create a draft using the CURL command below, but the resulting draft is type "defect". The RTC project is Jazz Foundation in the example below, but I have found that the dc:type that I specify is ignored on more than just this project.

curl.exe -k -H "Content-Type: application/x-oslc-cm-change-request+json" -H "Accept: application/json" -X POST -d @newtask.json https://jazz.net/jazz/oslc/contexts/_Q2fMII8EEd2Q-OW8dr3S5w/drafts/workitems

This is the content of newtask.json:
{
    "dc:title": "This is Lori's task draft",        
    "dc:type":{"rdf:resource":"https:\/\/jazz.net\/jazz\/oslc\/types\/_Q2fMII8EEd2Q-OW8dr3S5w\/task"},      
    "rtc_cm:teamArea":{"rdf:resource": "https:\/\/jazz.net\/jazz\/oslc\/teamareas\/_I3iq8BTPEd6zz6xdSaYlGQ"},
    "rtc_cm:filedAgainst":{"rdf:resource": "https:\/\/jazz.net\/jazz\/resource\/itemOid\/com.ibm.team.workitem.Category\/_v2l5gBTPEd6zz6xdSaYlGQ"},       
}

The resulting draft is here, but it is type Defect rather than Task: https://jazz.net/jazz/web/projects/Jazz%20Foundation?draftId=_-LMWQHtdEeaRDptxjI8dMA#action=com.ibm.team.workitem.newWorkItem&ts=1473955450942&draftId=_-LMWQHtdEeaRDptxjI8dMA

Accepted answer


permanent link
Ralph Schoon (60.7k33643) | answered Jun 05 '20, 8:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jun 05 '20, 8:58 a.m.
Ralph Schoon selected this answer as the correct answer

One other answer



permanent link
Marcin Blacha (14617) | answered Jun 05 '20, 7:04 a.m.

Did you found a solution? On RTC 6.0.6 I have same problem.

Your answer


Register or to post your answer.