It's all about the answers!

Ask a question

Deleting a Link from a Work Item


Roanna Rague (21212) | asked Oct 11 '17, 6:13 p.m.

Hello, sorry for all the questions, I am still trying to learn this API.

My question is how to delete a link from a work item. And what I mean by that, is along the lines of how to delete a parent link or child link from a work item. The problem is that we have an operational behavior that prevents a certain work item from being saved if it is not a 'Risk' or 'Issue' parent. So if the user accidently creates a link to a parent that is say a 'Meeting', then the work item cannot save, and even if you delete the 'Meeting' parent and try to create a 'Risk' or 'Issue' parent, the work item still thinks it has a 'Meeting' parent, and won't allow two parent references.

I'd like to programmatically delete a link to a parent that is not a 'Risk' or 'Issue', that way, the user can set the proper one?

I've done some research, and I believe you have to get a copy of the work item? I know IReference, and getNewReferences() and things like such will come in to play, I am just not quite sure how to go about deleting a link?

Thank you

2 answers



permanent link
Ralph Schoon (63.1k33646) | answered Oct 12 '17, 3:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

As far as I can tell, you basically use com.ibm.team.workitem.common.model.IWorkItemReferences.remove(IReference) to remove the references you no longer want. See com.ibm.js.team.workitem.commandline.helper.WorkItemUpdateHelper.updateLinks(ParameterValue, List<Exception>)


in the Work Item Command Line ( https://rsjazz.wordpress.com/2017/03/29/the-work-item-command-line-is-now-open-source/ ) if you want to see more RTC Work Item API.


permanent link
Andy Chen (812) | answered Oct 12 '17, 12:18 a.m.

Hi,

The link below should have information that will help you out with deleting work item links with the Plain Java Client API

https://jazz.net/forum/questions/172804/rtc-is-there-any-way-to-delete-work-item-links-such-as-trace-to-in-batch

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.