Creating Tracks links using the Java API
Hi,
I am using the following code to create Tracks links between workitems of the same project area and repository.
If I set linkTypeToCreate to WorkItemLinkTypes.CONTRIBUTES_TO_WORK_ITEM the link is created but shown under another (second) "Tracks" element in the Eclipse workm item editor.
Therefore I am now using WorkItemLinkTypes.TRACKS_WORK_ITEM.
Am I doing sth wrong or is this an undocumented feature of the RTC API?
|
2 answers
I changed my implementation using your proposed LinkTrackingWorkItemOperation class.
It now works as expected.
Thank you for your support.
|
Ralph Schoon (63.1k●3●36●45)
| answered Feb 09 '15, 2:31 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Feb 09 '15, 2:46 a.m.
Link creation is a can of worms. The problem is understanding the correct way to create the ends. Also see: https://rsjazz.wordpress.com/2013/11/06/creating-clm-links-with-back-link/
This code works for me - note how the location is created: Location location = Location.namedLocation(workItem, ((ITeamRepository) workItem.getOrigin()) .publicUriRoot()); found.add(new InternalReference(endpoint, IReferenceFactory.INSTANCE .createReferenceFromURI(location .toAbsoluteUri()))); If you fail to create the Location type it needs, you have trouble deleting the references. Also note the additional save parameter to create back links. Note Internal location is just a class to hold the reference and the endpoint. Comments I will publish the whole code on my blog in the next few days.
Marko Tomljenovic
commented Feb 09 '15, 3:32 a.m.
I saw already your code using the WorkItemOperation. But that seems to be completely different than using the LinkManager interface.
I am looking forward your code.
But why can I delete the link in the Eclipse client but not in the WebClient? For me this is a bug either in Eclipse or Web Client.
The ILinkManager is a lower interface as far as I know. I am just using the methods I found in the SDK and that were working for me.
Marko Tomljenovic
commented Feb 09 '15, 3:53 a.m.
OK. Fine.
Then I will wait for your code snippet that resolves my problem.
But from what the ILinkManager description says this interface is all you need to create, save and delete links. I guess it was meant to ease the link handling.
ILinkManager interface description.
"Client library for use by Jazz clients to manage links in a particular team
repository. See {@link ILink} for details of link terminology and semantics,
and link type registration. This manager provides methods for creating,
* saving and deleting links, and a variety of methods for finding links."
Marko Tomljenovic
commented Feb 09 '15, 4:38 a.m.
I will file a PMR against it and keep you posted after I get feedback. Marko,
showing 5 of 6
show 1 more comments
|
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.
Comments
And I have another problem with my approach. In the Web client I cannot delete the created tracks links. I can remove them from the work item and then save. But after saving the work item is finished they again appear in the work item editor.
Does this happen only for the Tracks links you create through the API, or also for those created through a GUI ?
If I create a tracks link via the Web Client I can properly delete it from the Web as well.