It's all about the answers!

Ask a question

programmatically create link to related artifacts


r vijay (3676) | asked Dec 13 '11, 12:32 p.m.
Hi All,

I am trying to add related artifacts (basically a url) programmatically. But when i try to create link using

ILink link= ILinkFactory.INSTANCE.createLink(WorkItemLinkTypes.RELATED_ARTIFACT, sourceRef, targetRef);
linkManager.saveLink(link, monitor);

it requires source and target reference, which i think is not applicable for related artifact.

Can anyone please help on this...Thanks

regards,
Vijay

2 answers



permanent link
sam detweiler (12.4k6173200) | answered Dec 13 '11, 11:43 p.m.
well.. there are three objects there

the workitem (source)
the object of relatedness (uri)
and the link between them.

Sam

permanent link
r vijay (3676) | answered Dec 14 '11, 1:48 a.m.
Thanks Sam !! , it works , i am able to create related artifacts through code now..

well.. there are three objects there

the workitem (source)
the object of relatedness (uri)
and the link between them.

Sam

Your answer


Register or to post your answer.