It's all about the answers!

Ask a question

Problems in viewing programmatically created links


Abhishek Minde (7121912) | asked Jul 27 '09, 2:17 p.m.
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?


		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

Be the first one to answer this question!


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.