Deleting a Link from a Work Item
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
Ralph Schoon (63.1k●3●36●46)
| 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.
|
Hi,
|
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.