Linking RTC files to RQM
![]()
We have a java application which needs to create links between files in RTC with RQM test artifacts (Test cases ).
We can currently find existing file links using
public RelatedArtifactsDTO[] getRelatedArtifacts(IVersionableHandle[] itemStateHandles,
String gcURL, String[] options, IRepositoryProgressMonitorHandle monitor)
but this won't work to create new links. Is there a java API ( or any other viable way) that can create new links between files and artifacts ?
|
3 answers
![]() The API mentioned above is internal API. Please use public API - Reportable Rest API or OSLC API. For more details check https://jazz.net/wiki/bin/view/Main/RqmApi |
![]() Creating links programmatically is possible but it is a bit complicated. Also, one of the DTOs that you need to use is in an internal package. I don't know if this was intentional or a mistake on the part of the developers who implemented the feature.
Comments
Thank you for the detailed answer Micheal. . It helps me understand the whole workflow very well.
But the methods toLinkServiceId() and getInstanceId() are undefined for object of ILinkType.
Although I saw that they're present for the type ExternalLink.
Am I understanding something incorrectly here ?
Thank you.
Also ,
in the following snippet
// Create a commit parameter
ICommitParameter parm = ICommitParameter.FACTORY.create(cs);
parm.addItemToSave(item, links);
the method addItemToSave() takes the secnd parameter as ExternalLinkEntry.
Do we need to create externalLinks from ExternalLinkEntry somehow ? if so any tips for that.
Thank you.
Sorry, I am unable to edit my last comment.
I meant to ask if i need to add external links to ExternalLinkEntry entry and pass that as the second parameter in parm.addItemToSave(item, links);
Because the links parameter is of type Collection<? extends ExternalLinkEntry>
|
![]()
UPDATE
----
It seems that this code is working fine, I think I was just using a wrong URL format of the QM Testcase
It should be something like:
https://server:port/qm/oslc_qm/contexts/_XYZ/resources/com.ibm.rqm.planning.VersionedTestCase/_ABC
------
Hello Michael,
unfortunately this doesn't seem to work for me as well, I miss at least a part where the External Link is set to the Versionable.
I found another way to create such links, but while it actually creates the link and produces a changeset, after delivery this link is visible on the file but on in QM even though it looks the very same is one created via UI (which becomes visible immediately)
operation = IOperationFactory.instance.getChangePropertiesOperation(null);
linkType = ILinkTypeRegistry.INSTANCE.getLinkType("com.ibm.team.scm.service.file.references.testcase.link");
operation.addExternalLink(shareable, LinkTypeIdentifier.create(linkType), uri);
operation.run(null);
Is this one valid to use and do I have to trigger any LinkIndex action or something like this additionally to make the link visible in QM.
Thanks a lot
|
Comments
Michael