RTC API - linking changesets to workitems on deliver - serverside
Hi,
I'm trying to link workitems to changesets in an operation participant on a deliver but I'm getting this problem:
Links of this type may only be modified by the defining component.
Link Type: com.ibm.team.filesystem.workitems.change_set
Defining Component: com.ibm.team.filesystem.workitems
Requesting Component: testparticipant.extensionService2
using the method at https://jazz.net/forum/questions/82384/serverside-create-link-from-a-workitem-to-a-changeset
And when trying a different approach I ran into a very similar problem that looked something like this
Links of this type may only be modified by the defining component.
Link Type: com.ibm.team.filesystem.workitems.change_set
Defining Component: com.ibm.team.filesystem.workitems
Requesting Component: com.ibm.team.workitem
except I'm unsure about what the last line looked like. If it helps It was caused in the saveWorkItem2 method of the WorkItemServer class.
You can find the second method here:
rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/
From the looks of it I need to use a method in the 'Defining component' in order to the save the link. But I'm clueless as to how I would go about getting access to this component.
I tried the scm service
IScmService scmService = getService(IScmService.class);
but the CreateLinks method says that it is "experimental" when highlighted.
Any help is appreciated.
Thanks!.
RTC:4.0.7
I'm trying to link workitems to changesets in an operation participant on a deliver but I'm getting this problem:
Links of this type may only be modified by the defining component.
Link Type: com.ibm.team.filesystem.workitems.change_set
Defining Component: com.ibm.team.filesystem.workitems
Requesting Component: testparticipant.extensionService2
using the method at https://jazz.net/forum/questions/82384/serverside-create-link-from-a-workitem-to-a-changeset
And when trying a different approach I ran into a very similar problem that looked something like this
Links of this type may only be modified by the defining component.
Link Type: com.ibm.team.filesystem.workitems.change_set
Defining Component: com.ibm.team.filesystem.workitems
Requesting Component: com.ibm.team.workitem
except I'm unsure about what the last line looked like. If it helps It was caused in the saveWorkItem2 method of the WorkItemServer class.
You can find the second method here:
rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/
From the looks of it I need to use a method in the 'Defining component' in order to the save the link. But I'm clueless as to how I would go about getting access to this component.
I tried the scm service
IScmService scmService = getService(IScmService.class);
but the CreateLinks method says that it is "experimental" when highlighted.
Any help is appreciated.
Thanks!.
RTC:4.0.7
One answer
As described in https://rsjazz.wordpress.com/2014/12/03/creating-custom-link-types-for-rational-team-concert/ a component can request a link type to be exclusively usable by the defining component.
If you try to create that specific link type and the component ID you bind your extension to is not the one of that defining component, the API will refuse to create the link.
If you try to create that specific link type and the component ID you bind your extension to is not the one of that defining component, the API will refuse to create the link.