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

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

0 votes


Be the first one to answer this question!

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
× 411
× 58

Question asked: Feb 05 '19, 12:37 p.m.

Question was seen: 1,966 times

Last updated: Feb 05 '19, 12:37 p.m.

Confirmation Cancel Confirm