Can I use the REST API to link workitems?
Hi
I am trying to find the right URL to send to the RTC server to create a link between two work items. Is this possible? many thanks anthony p.s Bonus points if I can create links to multiple work items (ie one to many) |
One answer
Simply PUT the below content to the resource URI of a workitem, e.g.
https://clm405:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/43 <rdf:RDFIn this example, the links are established so that WI 43 "Depends On" WI 61 and WI 62. Note that the same link type will be overwritten, so if you want to "add" work items to the same link type, you need to add the existing work items in the PUT payload. For example, if later on you want to link WI 63 so that WI 43 "Depends On" WI 63 as well, you need to put all three work items in the PUT payload. To find out what link types are available for the work item type, check the instance shape of the work item type, such as https://clm405:9443/ccm/oslc/shapes/workitems/_RsxIUGLBEeOj4c1n9GOJ3Q (this is Task in my system) You can get the instanceShape URL when you GET a work item of this type (look for <oslc:instanceShape>). |
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.