It's all about the answers!

Ask a question

Unable to link Custom Work Item with Change Set


Rogelio Lopez (211) | asked Jun 18 '15, 3:09 p.m.
edited Jun 19 '15, 2:13 a.m. by Ralph Schoon (59.4k23642)
 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;
}

Comments
Ralph Schoon commented Jun 19 '15, 2:13 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 This is one of the worst questions I have ever seen. No information about what you see and what you do and why.

One answer



permanent link
Ralph Schoon (59.4k23642) | 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


Register or to post your answer.