Creating new WorkItems Server Side
Hi,
Can anyone tell me if IWorkItemServer.createWorkItem2 is the only method of creating a new WorkItem on the server.
By that I mean without the eclipse client.
I have worked through some of the examples and have working services etc, but the support for creating WorkItems without resorting to Client interfaces seems limited (unless I am missing something)
Can anyone tell me if IWorkItemServer.createWorkItem2 is the only method of creating a new WorkItem on the server.
By that I mean without the eclipse client.
I have worked through some of the examples and have working services etc, but the support for creating WorkItems without resorting to Client interfaces seems limited (unless I am missing something)
Accepted answer
I guess I am asking.
Is this the right way to go about server side creation of work items?
Is this the right way to go about server side creation of work items?
IProcessServerService processServerService = ...
IWorkItemServer workItemServer = ...
try {
IProjectArea projectArea = (IProjectArea)processServerService.findProcessArea("<MyProjectAreaName>", null);
IWorkItemType workItemType = workItemServer.findCachedWorkItemType(projectArea, "<MyWorkItemType>");
IWorkItem workItem = workItemServer.createWorkItem2(workItemType);
// begin setting up various attributes
...
// end setting up varous attributes
IStatus status = workItemServer.saveWorkItem2(workItem, null, null);
} catch (TeamRepositoryException e) {
e.printStackTrace();
}