Adding a 'related change request' between work items using the RTC Java API
Alexander Kershaw (13●2●3)
| asked Jul 03 '14, 9:49 a.m.
edited Jul 03 '14, 10:19 a.m. by Arne Bister (2.6k●1●28●32)
I have the IWorkItemHandle object of 2 work items on different servers. How do I then add a 'related change request' link between them?
Thanks, Alex |
2 answers
Hi Alex,
This is very much psuedo-code, but hopefully will give you enough pointers to work with the RTC API to achieve what you would like to do. You say you have your handles already, so in this example:
IWorkItemHandle localHandle;
First up, you need a link manager:
public ILinkManager linkManager = (ILinkManager) getTeamRepository().getClientLibrary(ILinkManager.class);
The link manager is used to update the links on the localHandle to the remoteHandle. Next create a pair of localRef and remoteRef references using the link manager:
IItemReference localRef = linkManager.referenceFactory().createReferenceToItem(localHandle);
Then create and save the link:
ILink link = linkManager.createLink("com.ibm.team.workitem.linktype.relatedartifact", localRef, remoteRef);
Hope that helps.
Cheers, Steve
|
Alexander
I think this link should help you http://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/
The blog also contains other useful examples
Comments
Alexander Kershaw
commented Jul 07 '14, 6:05 a.m.
Hi Rosa,
All I can suggest is to look at existing links to try to figure out how they should look like- that is what I have to do if I are bold enough to look at a new API. I would hope https://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/ should provide you with the right information. It is important to find out what the link type is. I would start here: https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/ . That uses ILinkConstants.CHANGESET_WORKITEM_LINKTYPE_ID. Please be aware that there is also SCM API involved somehow. I am not sure what your link type represents.
Alexander Kershaw
commented Aug 06 '14, 6:33 a.m.
Hi Ralph - I've tried replacing both of my potential solutions (from my previous comment) with ILinkConstants.CHANGESET_WORKITEM_LINKTYPE_ID as the id and it still doesn't work. I can't find any other suggestions in the links you've posted.
Ralph Schoon
commented Aug 06 '14, 10:58 a.m.
| edited Aug 06 '14, 10:58 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I can't help a lot here. If the link is between items in different repositories, then they are CLM links. CLM links are created in a different way. I have some hints here: http://rsjazz.wordpress.com/2013/11/06/creating-clm-links-with-back-link/
|
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.