How can you copy a workitem into a different project area using the java server API?
I'm trying to create a server extension that will copy of a workitem into a different project area on a work item save.
Right now I'm creating a new workitem, filling out the fields with data, and then using the ServerCopyToProjectOperation class to save it into a different project area. This was working fine on our 6.0.1 servers, but when the extension was moved to our 6.0.5 server, we started getting NoSuchMethodError with this class. Is there a different way to do this? I know the RTC client has the option to copy a workitem into a different project area but I don't know how to actually access that functionality from the server api.
This is the snippet of code I'm currently using:
IWorkItemReferences workItemReferences = wiServer.resolveWorkItemReferences(newWI, null);
WorkItemWrapper wiWrapper = new WorkItemWrapper(newWI, workItemReferences, null);
ServerCopyToProjectOperation op = new ServerCopyToProjectOperation(targetArea, true, false, true);
op.run(wiWrapper, wiServer, null, null);
wiServer.saveWorkItem2(newWI, null, null);
WorkItemWrapper wiWrapper = new WorkItemWrapper(newWI, workItemReferences, null);
ServerCopyToProjectOperation op = new ServerCopyToProjectOperation(targetArea, true, false, true);
op.run(wiWrapper, wiServer, null, null);
wiServer.saveWorkItem2(newWI, null, null);