Problems in viewing programmatically created links
Hi,
I am creating links between two workitem types, enhancement and defect. Enhancement has been created by me.
I am using the following code to create a "relatedWorkitem" link between source and destination workitems.
After I create link using the code, it is adding the link in the references for the source workitem. And when I print them or get the references using getReferences it shows up. However, I am not able to see it in the links section of the WebUI for that source item, specifically "enhancement". I can see it in the defect links section.
Is there anything I am missing?
Thanks,
Abhishek
I am creating links between two workitem types, enhancement and defect. Enhancement has been created by me.
I am using the following code to create a "relatedWorkitem" link between source and destination workitems.
After I create link using the code, it is adding the link in the references for the source workitem. And when I print them or get the references using getReferences it shows up. However, I am not able to see it in the links section of the WebUI for that source item, specifically "enhancement". I can see it in the defect links section.
Is there anything I am missing?
com.ibm.team.workitem.common.model.IWorkItem sourceWorkitem = getWorkItem(Integer.parseInt(sourceId));
com.ibm.team.workitem.common.model.IWorkItem destWorkitem = getWorkItem(Integer.parseInt(destId));
try {
IWorkItemClient workItemClient = (IWorkItemClient) teamRep.getClientLibrary(IWorkItemClient.class);
IWorkItemWorkingCopyManager workingCopyManager= workItemClient.getWorkItemWorkingCopyManager();
IWorkItemHandle handle = (IWorkItemHandle)sourceWorkitem.getItemHandle();
workingCopyManager.connectCurrent(handle, com.ibm.team.workitem.common.model.IWorkItem.FULL_PROFILE, null);
WorkItemWorkingCopy workingCopy= workingCopyManager.getWorkingCopy(handle);
IWorkItemReferences references = workingCopy.getReferences();
IItemReference ref = WorkItemLinkTypes.createWorkItemReference(destWorkitem);
references.add(WorkItemEndPoints.RELATED_WORK_ITEM,ref );
workingCopy.save(null);
workingCopyManager.disconnect(handle);
Thanks,
Abhishek