How to RTC a workitem link a RRC artifact in program
Accepted answer
Hi, this depends on what you want to do. Here is a summary with references:
https://rsjazz.wordpress.com/2012/10/20/following-calm-links-using-the-java-client-or-server-api/
here the referenced links.
https://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/
https://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/
Note, Wordpress appears to be blocked in China, what you can try is the approach below. At least from Hong Kong this appears to work:
.
In case of WordPress blogs, you can append the string ".nyud.net" to the blog URL and it should open just fine. For instance, if the main blog is located at labnol.wordpress.com, you can access a mirror image of this site from labnol.wordpress.com.nyud.net.
Comments
Sorry I can not access any of them, is there any detail sample for this solution ? I think 'link for OSLC' is often needed since 3.x
All my detail samples are on that blog. If you can't access it, you can try to follow Lauren's suggestion.
Hi Ralph,
Thanks very much for your link, i can access them now. One questions about the code:
IReference source = refFactory.createReferenceToItem(parent);
Now my source is a URL string about a artifact in RRC, and target is a workitem in RTC. My question is how to transfer the URL string in RRC to IItemHandle format ? I am newer about this part, very appreciate your always support.
IReference target = refFactory.createReferenceToItem(blocked);
Please see the answer (limits on comments). How did you get at the link? I would like to be able to provide that trick to others.
Yes, I already got the RRC artifact like this :
https://localhost:9443/rm/resources/_zSZUYC7REeKQxbmS_9nbjw
I was actually asking how you managed to reach Wordpress 8-)
Hi Ralph,
Thanks so much for your help. It works now.
2 other answers
reference = IReferenceFactory.INSTANCE.createReferenceFromURI(new URI("https://clm.example.com:9447/qm/oslc_qm/contexts/_Lm2UIACBEeGZqMjM3RLKTw/resources/com.ibm.rqm.planning.VersionedTestCase/_dJzNgQCBEeGZqMjM3RLKTw"));
workingCopy.getReferences().add(ILinkTypeRegistry.INSTANCE
.getLinkType(WorkItemLinkTypes.TESTED_BY_TEST_CASE).getTargetEndPointDescriptor(),reference);
You create a URI from the URL:
new URI("https://clm.example.com:9447/qm/oslc_qm/contexts/_Lm2UIACBEeGZqMjM3RLKTw/resources/com.ibm.rqm.planning.VersionedTestCase/_dJzNgQCBEeGZqMjM3RLKTw")
Then you create a reference from this URI.
reference = IReferenceFactory.INSTANCE.createReferenceFromURI(new URI("https://clm.example.com:9447/qm/oslc_qm/contexts/_Lm2UIACBEeGZqMjM3RLKTw/resources/com.ibm.rqm.planning.VersionedTestCase/_dJzNgQCBEeGZqMjM3RLKTw"));
Here some other code that does the same:
IEndPointDescriptor endpoint3 = ILinkTypeRegistry.INSTANCE.getLinkType(WorkItemLinkTypes.AFFECTED_BY_DEFECT).getTargetEndPointDescriptor();
LinkURIOperation linkOp = new LinkURIOperation(endpoint,uri);
With this code the LinkURIOperation does:
reference = IReferenceFactory.INSTANCE.createReferenceFromURI(fURI);
workingCopy.getReferences().add(fEndpointDescriptor,reference);