It's all about the answers!

Ask a question

Which handle do i disconnect??

Green Elk (1319) | asked Feb 01 '17, 11:04 a.m.

 Here is some simple client which i'm uusing to create Workitems

       IWorkItemClient wiClient = .... 
       IWorkItemType workItemType = wiClient.findWorkItemType(oProject, "com.abd.type1", null);
       IWorkItemWorkingCopyManager wiwcmgr = ....
IWorkItemHandle workItemHandle = wiwcmgr.connectNew(workItemType, null);
WorkItemWorkingCopy workingCopy = wiwcmgr.getWorkingCopy(workItemHandle);
IWorkItem wiWorkingCopy = workingCopy.getWorkItem(); wiWorkingCopy.setHTMLSummary(XMLString.createFromPlainText("title1"));;
It's not clear to me what I have to free up (disconnect) at the end. I was expecting that i would disconnect workItemHandle, as that is what i was given when i did the connect, however an examples i've seen disconnects using wiWorkingCopy. Can someone explain the subtleties please ? The code may need to create hundreds of items so i'm trying to avoid handle leakage in the client and the server


One answer

permanent link
Ralph Schoon (63.2k33646) | answered Feb 01 '17, 11:48 a.m.

 I would suggest to not use that API and to follow and use an workItemOperation as described in section Alternative to Create and Modify WorkItems

Other than that workItemHandle and workingCopy and wiWorkingCopy represent pretty much the same object just with different interfaces.

Your answer

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