Move workitem from a project area to another
Dear
I'm developing a server plug-in that moves workitem from a project area to another.
When status of workitem is in invalidated, it should be moved to another project area. So I'm developing a server plug-in for this.
I'm looking for APIs for that, but I can't find it.
Can anybody provide a pesudo-code for this purpose?
Any help will be appreciated.
I'm developing a server plug-in that moves workitem from a project area to another.
When status of workitem is in invalidated, it should be moved to another project area. So I'm developing a server plug-in for this.
I'm looking for APIs for that, but I can't find it.
Can anybody provide a pesudo-code for this purpose?
Any help will be appreciated.
2 answers
I found how to do it.
Thanks everyone.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( newState!=null ) {
IProcessArea processArea = getProcessServerService().findProcessArea("Garbage", null);
IWorkItem workingCopy = (IWorkItem)newState.getWorkingCopy();
IWorkItemReferences workItemReferences = getWorkItemService().resolveWorkItemReferences(workingCopy, null);
WorkItemWrapper wiWrapper = new WorkItemWrapper(workingCopy, workItemReferences, "");
ServerCopyToProjectOperation op = new ServerCopyToProjectOperation(processArea.getProjectArea(), true);
op.run(wiWrapper, getWorkItemService());
done=true;
getWorkItemService().saveWorkItem2(workingCopy, null, null);
}
Thanks everyone.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( newState!=null ) {
IProcessArea processArea = getProcessServerService().findProcessArea("Garbage", null);
IWorkItem workingCopy = (IWorkItem)newState.getWorkingCopy();
IWorkItemReferences workItemReferences = getWorkItemService().resolveWorkItemReferences(workingCopy, null);
WorkItemWrapper wiWrapper = new WorkItemWrapper(workingCopy, workItemReferences, "");
ServerCopyToProjectOperation op = new ServerCopyToProjectOperation(processArea.getProjectArea(), true);
op.run(wiWrapper, getWorkItemService());
done=true;
getWorkItemService().saveWorkItem2(workingCopy, null, null);
}
Dear
I'm developing a server plug-in that moves workitem from a project area to another.
When status of workitem is in invalidated, it should be moved to another project area. So I'm developing a server plug-in for this.
I'm looking for APIs for that, but I can't find it.
Can anybody provide a pesudo-code for this purpose?
Any help will be appreciated.