How to set parent link when creating a work item by OSLC?
I found the following documents:
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2
https://jazz.net/library/article/352
There are some explanation in those documents how to create a work item by OSLC,
however, how to set parent link on work item creation is not mentioned.
May you please help?
Accepted answer
One other answer
Hi Eric,
There are different types of links which could be used (Set Parent, Add children, Add Blocks etc., are some examples)
Here is an example of how to add a parent link to a work item using JSON. You could POST the following JSON request to use "Set Parent" link of a work item
{
"rtc_cm:com.ibm.team.workitem.linktype.parentworkitem.parent": {
"rdf:resource": "<RTC_URL>/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/<Parent_WorkIem_ID>"
}
}
Similarly for a "Blocked By" link the following request could be used
{
"rtc_cm:com.ibm.team.workitem.linktype.blocksworkitem.blocks": {
"rdf:resource": "<RTC_URL>/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/<Blocking_WorkItem_ID>"
}
}
We could determine which JSON object to use for the request based on the resource shape of a work item from the resource catalog.
Hope this helps. Thanks!!