It's all about the answers!

Ask a question

How to set the filiation of two workitems by programming?


David Guo (2536) | asked Jun 07 '10, 11:04 p.m.
Assume there are two workitems:One workitem ID is 100,the other ID is 102.

I want set the one(ID:100) workitem is another's(ID:102) parent.

How to get it by programming?

Thanks a lot.

One answer



permanent link
Michele Pegoraro (1.8k12110100) | answered Jun 08 '10, 3:30 a.m.
Hi,
you have to use the ILinkServiceLibrary.createLink methods, referring the link type id (which is "com.ibm.team.workitem.linktype.parentworkitem"), and the two workitem IReference (obtained by IReferenceFactory.createReferenceToItem method, whit IReferenceFactory obtained by ILinkServiceLibrary.referenceFactory() ).

After you have create the link you have to save it using ILinkServiceLibrary.saveLink method.

Best regards,
Michele.

Your answer


Register or to post your answer.