RTC Java/Plugin API - How to set a project Area for Work Item?
What's the API method call to set Project Area for the given work item? Basically I am trying to move a Work Item from Project Area 'A' to Project Area 'B'.
I have a IWorkItem from WorkItemWorkingCopy, but I do not see any set method(s) to set Project Area. Someone mentioned that setContextId should work, but I don't think it works.
Below is the code snippet. The Save Status is 'OK'.
try
{
wiWorkingCopyMgr.connect(workItem, IWorkItem.FULL_PROFILE, monitor);
wiWorkingCopy = wiWorkingCopyMgr.getWorkingCopy(workItem);
copiedWorkItem = wiWorkingCopy.getWorkItem();
copiedWorkItem.setContextId(targetProjectArea.getItemId());
wiWorkingCopy.save(monitor);
}
catch (TeamRepositoryException e)
{
// Log it
}
One answer
Comments
I would suggest to follow https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/ and do the Extensions Workshop. Use the Extensions workshop workspace for API development. Make the projects all plugin projects to be able to use the PDE show the SDK and the Source code.
"Java SDK call to setup the project area" I can not make sense of this in the current topic. Code to setup project areas are in the snippets that ship with the plain java client libraries.
I think "setup the project area " was a typo ... I believe he just meant "set the project area".
The work item creation call includes the project area the work item lives in. That sets the project area. I am not aware of a call that sets a different project area.