How to move work item to other project area using java client API
2 answers
You can look at the code how they do it. I doubt there is a special API. You have to find the source and target attributes and create a value mapping in any case, because the UUID's and ID's of referenced items are almost certainly different in both project areas in most of the cases.
Comments
HI Ralph, <o:p> </o:p>
I was understanding about class CopyToProjectArea, as you mentioned in your answer in this link , performFinish() method does the move of work item. But I was not able to understand how it happens as this method is called nowhere in CopyToProjectArea.class
Any suggestions
<o:p> </o:p>
It is just a UI pattern and how the wizards (superclass) work. If you had bothered to set a debug break point in a debug eclipse client, you would see how it gets called once you press finish.
Please also note, that the code here is part of the RTC Client SDK. It is not a part of the plain java client libraries and it is also internal code for all I can see. I have looked at that code a while back, because I wanted to do what you are attempting but Did not find the time to really pursue the task,
Hi Ralph,
I looked at it, and that is used. Note it is com.ibm.team.workitem.rcp.ui.internal.wizards.CopyToProjectAreaOperation which means it is internal client code and not part of the Plain Java Client Libraries.
I was surfing on google and jazz.net to find If I can get anything to move work item from project area to another.
I did not find client Java API to move work item but I found server API to move work item.
Exact code is given in https://jazz.net/forum/questions/53755/move-workitem-from-a-project-area-to-another this link
I did it myself and work item is moved to specified project area, Some changes in code needs to be done however.
Comments
The link above points to this post and not to one with server API.
Code is given in the link. If required I can also provide executable code to move work item
If I click the link, I end up in THIS QUESTION
My bad, I hyperlinked my own question. I updated my answer
The code is server API. I can't see how this would work in the client API com.ibm.team.workitem.rcp.ui.internal.wizards.CopyToProjectAreaOperation would, but is part of the RTC Eclipse client internal API and not the Plain Java Client Libraries.
Yes code is server API, I developed 'participant' to move work item from project area to other project area on work item save operation.
WorkItemWrapper wiWrapper = new WorkItemWrapper(workingCopy, workItemReferences, "");
ServerCopyToProjectOperation op = new ServerCopyToProjectOperation(processArea.getProjectArea(), true, false, false);
op.run(wiWrapper, workItemServer, linkServiceLibrary, contentService);
These server API are responsible to move work item from project area to other.
I guess com.ibm.team.workitem.common.internal.CopyToProjectOperation is counter client side API. I did not use it or developed a program using it though.
Hi Ralph,
I had a doubt about saving work item.
If work item is moved from project area to other project area from RTC eclipse or web UI, it is unsaved in that project area i.e. User has to save work item in specified project area after it is moved.
Is it possible to keep work item unsaved if work item is being modified by client api or server api?