Unable to link Custom Work Item with Change Set
Rogelio Lopez (21●1)
| asked Jun 18 '15, 3:09 p.m.
edited Jun 19 '15, 2:13 a.m. by Ralph Schoon (63.5k●3●36●46)
public boolean link(ITeamRepository repository,
IWorkItemHandle workItemHandle, IChangeSetHandle chgSetHandle)
throws AutoconfigProcessorRTCException {
WorkItemWorkingCopy wc = null;
IWorkItemClient service = null;
IItemReference reference = null;
IEndPointDescriptor endpoint = null;
IDetailedStatus detailStatus = null;
IItemType itemType = null;
IItemHandle itemHandle = null;
try {
service = (IWorkItemClient) repository
.getClientLibrary(IWorkItemClient.class);
System.out.println("WorkItemHandle" + workItemHandle.getItemType().getName());
wc = service.getWorkItemWorkingCopyManager().getWorkingCopy(
workItemHandle);
itemType = chgSetHandle.getItemType();
System.out.println("ItemType: "+ itemType.getName());
itemHandle = itemType.createItemHandle(chgSetHandle.getItemId(),
chgSetHandle.getStateId());
reference = IReferenceFactory.INSTANCE
.createReferenceToItem(itemHandle);
endpoint = LinkTypeRegistry.INSTANCE.getLinkType(WorkItemLinkTypes.RELATED_CHANGE_MANAGEMENT).getTargetEndPointDescriptor();
wc.getReferences().add(endpoint, reference);
} catch (AutoconfigProcessorRTCException e) {
throw new AutoconfigProcessorRTCException(
"Error linking workitem with change set");
}catch(Exception e){
logger.info("Exception" + e.getMessage());
logger.info("Exception" + e.getCause());
}
logger.info("The workitem was associated successfully to change set");
return true;
}
|
One answer
Ralph Schoon (63.5k●3●36●46)
| answered Jun 19 '15, 2:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
As far as I know, this link can only be created by the SCM component.
|
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.
Comments
This is one of the worst questions I have ever seen. No information about what you see and what you do and why.