Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Unable to link Custom Work Item with Change Set

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

0 votes

Comments

 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
 As far as I know, this link can only be created by the SCM component. 

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Jun 18 '15, 3:09 p.m.

Question was seen: 2,492 times

Last updated: Jun 19 '15, 2:14 a.m.

Confirmation Cancel Confirm