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

create links programmatically

Hi,

I'm having trouble creating links programmatically. I created this method, by copying and pasting from various code snippets from the Jazz code.

public static void createBlocks(IWorkItem blocked, int idBlocks, IWorkItemServer workItemService,
IRepositoryItemService repoService) throws TeamRepositoryException {
// add references
IWorkItem newWI = workItemService.findWorkItemById(idBlocks, IWorkItem.FULL_PROFILE, null);
IReference newRef = WorkItemLinkTypes.createWorkItemReference(newWI);
IWorkItemReferences refs =workItemService.resolveWorkItemReferences(blocked, null);
ILinkType unDirectedType = ILinkTypeRegistry.INSTANCE.getLinkType(WorkItemLinkTypes.BLOCKS_WORK_ITEM);
IEndPointDescriptor blocks = unDirectedType.getTargetEndPointDescriptor();
refs.add(blocks, newRef);

// save the workitem
workItemService.saveWorkItem2(blocked, workItemService.resolveWorkItemReferences(blocked, null), null);
}

However, my method doesn't create any links. Am I on the right track? Does anybody have an idea what I did wrong? Thanks!

Annie

0 votes


Be the first one to answer this question!

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
× 10,941

Question asked: Mar 20 '08, 3:43 p.m.

Question was seen: 6,945 times

Last updated: Mar 20 '08, 3:43 p.m.

Confirmation Cancel Confirm