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

How to move work item to other project area using java client API

 I want to move workitem from project area to other project area using java client API.
Is there any API which can move work item from project area to other project area.

0 votes



2 answers

Permanent link
By opening the Copy/Move Work item Wizard in the Eclipse client and using the Plugin Spy (SHIFT+ALT+F1) on the dialog window you can find and open the wizard class com.ibm.team.workitem.rcp.ui.internal.wizards.CopyToProjectAreaWizard

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.

0 votes

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 was unable to set a debug break point in a debug eclipse client, but I studied about performFinish() method,
I believe that 
CopyToProjectAreaOperation operation= new CopyToProjectAreaOperation(name, fTargetArea, true, fMove, fResolveSource, fMoveAttachments, fCopyAttachments);

operation.run(fWorkItems.toArray(new IWorkItemHandle[fWorkItems.size()]), monitor);

This code snippet is responsible for moving work item.
Is it right?

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.


Permanent link
Hi Ralph,
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.

0 votes

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?

showing 5 of 7 show 2 more comments

Your answer

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,951
× 411
× 369

Question asked: Feb 18 '16, 4:50 a.m.

Question was seen: 5,362 times

Last updated: Jun 23 '16, 6:16 a.m.

Confirmation Cancel Confirm