It's all about the answers!

Ask a question

How to RTC a workitem link a RRC artifact in program


Debo Xiong (3146) | asked Nov 20 '12, 5:44 a.m.
Now we have the RRC artifact link and document URL is also exist. In RTC, how to a workitem link the RRC artifact ? Is there any API to reuse?
Many thanks.

Accepted answer


permanent link
Ralph Schoon (63.1k33645) | answered Nov 20 '12, 6:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Debo Xiong selected this answer as the correct answer

Comments
Debo Xiong commented Nov 20 '12, 7:22 a.m.

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


Ralph Schoon commented Nov 20 '12, 7:26 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

All my detail samples are on that blog. If you can't access it, you can try to follow Lauren's suggestion.


Debo Xiong commented Nov 20 '12, 9:13 a.m.

Hi Ralph,
Thanks very much for your link, i can access them now. One questions about the code:
IReference source = refFactory.createReferenceToItem(parent);
IReference target = refFactory.createReferenceToItem(blocked);
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.


Ralph Schoon commented Nov 20 '12, 9:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Debo Xiong commented Nov 20 '12, 9:45 a.m.

Yes, I already got the RRC artifact like this :
https://localhost:9443/rm/resources/_zSZUYC7REeKQxbmS_9nbjw


Ralph Schoon commented Nov 20 '12, 9:54 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I was actually asking how you managed to reach Wordpress 8-)


Debo Xiong commented Nov 20 '12, 8:58 p.m.

Hi Ralph,
Thanks so much for your help. It works now.

showing 5 of 7 show 2 more comments

2 other answers



permanent link
Ralph Schoon (63.1k33645) | answered Nov 20 '12, 9:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi, this is kind of hidden but explained using this code to call the client api:

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);



permanent link
Lauren Hayward Schaefer (3.3k11727) | answered Nov 20 '12, 6:52 a.m.
JAZZ DEVELOPER
Hi,

I believe it is possible to link from a work item to a RRC artifact using OSLC.  https://jazz.net/forum/questions/87628/linking-two-artifacts-using-rrc-api has more infomration.

Comments
Debo Xiong commented Nov 20 '12, 7:28 a.m.

Hi ,
can you share more information ?


Lauren Hayward Schaefer commented Nov 20 '12, 7:35 a.m.
JAZZ DEVELOPER

Hi,
Did you look at Gabriel's response in the forum post I linked to?

Your answer


Register or to post 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.