Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Delete related links with REST API

I use method PUT for add related link, it's work fine on cUrl.

@echo { "rdf:resource":"%HOST%/itemName/com.ibm.team.workitem.WorkItem/%ID_UPDATED_WI%" } > somelink.json

curl.exe -# -k -b %COOKIES% -H "Content-Type: application/x-oslc-cm-change-request+json" -H "Accept: application/X-Jazz-CSRF-Prevent" -X PUT --data-binary @somelink.json "%HOST%/oslc/workitems/%ID_ADDED_WI%/rtc_cm:com.ibm.team.workitem.linktype.copiedworkitem.copiedFrom"


but when I try delete that link by method DELETE - it doesn't work. What I can delete it?

0 votes


Accepted answer

Permanent link
If you mean the HTTP DELETE operation, then no, you cannot use it. Even if you can use it, you delete the WI instead, which is not what you want.

To delete a link, do a PUT with all the existing links except the one that you don't want any more.
Pavel Cikota selected this answer as the correct answer

0 votes

Comments

Thank you to answer!

I have in WI 211 links to 201, 209 and 210. I need delete link 209. What I need change in command?

e.g. If I PUT --data-binary @somelink.json "%HOST%/oslc/workitems/210/rtc_cm:com.ibm.team.workitem.linktype.copiedworkitem.copiedFrom" no links delete.

"To delete a link, do a PUT with all the existing links except the one that you don't want any more."

How to do it?

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 481
× 27
× 17

Question asked: Sep 07 '16, 9:38 a.m.

Question was seen: 2,478 times

Last updated: Sep 08 '16, 11:34 p.m.

Confirmation Cancel Confirm