Programmatic updation of work items
3 answers
Can someone point me to an example for updating work items in RTC?
I saw the work item creation here: https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation
but a similar plain Java client example would be great. Thanks in advance.
Hi, this is code I think I found on this forum and works for me:
IWorkItem workItem = workItemClient.findWorkItemById(id, IWorkItem.SMALL_PROFILE, null);
IWorkItemWorkingCopyManager wcm = workItemClient.getWorkItemWorkingCopyManager();
wcm.connect(workItem, IWorkItem.FULL_PROFILE, null);
try {
WorkItemWorkingCopy wc = wcm.getWorkingCopy(workItem);
wc.getWorkItem().setHTMLSummary(XMLString.createFromPlainText(summary));
IDetailedStatus s = wc.save(null);
if (!s.isOK()) {
throw new TeamRepositoryException("Error saving work item",
s.getException());
}
} finally {
wcm.disconnect(workItem);
}
System.out.println("Modified work item: " + workItem.getId() + ".");