Work Item Creation from Server Side Plugin.
Accepted answer
11 other answers
Hi All,
I have created the operationParticipant by using the createworkItem2() method. But after state change of workitem It is not generating workitem automatically. Here is my code :
if (state.equals(Inprogress))
{
IProcessServerService processServerService = getService(IProcessServerService.class); ;
IWorkItemServer workItemServer =(IWorkItemServer) getService(IWorkItemServer.class);
String Pa = newWorkItem.getProjectArea().toString();
IProjectArea projectArea = (IProjectArea)processServerService.findProcessArea(Pa, null);
String WItype = newWorkItem.getWorkItemType();
IWorkItemType workItemType = workItemServer.findCachedWorkItemType(projectArea, WItype);
IWorkItem workItem = workItemServer.createWorkItem2(workItemType);
// Set the Attributes of Task work item.
workItem.setHTMLSummary(XMLString.createFromPlainText("Automatic WI"));
workItem.setOwner(newWorkItem.getOwner());
workItem.setCategory(newWorkItem.getCategory());
workItem.setTarget(newWorkItem.getTarget());
workItemServer.saveWorkItem3(workItem, null, null, null);
}
I have created the operationParticipant by using the createworkItem2() method. But after state change of workitem It is not generating workitem automatically. Here is my code :
if (state.equals(Inprogress))
{
IProcessServerService processServerService = getService(IProcessServerService.class); ;
IWorkItemServer workItemServer =(IWorkItemServer) getService(IWorkItemServer.class);
String Pa = newWorkItem.getProjectArea().toString();
IProjectArea projectArea = (IProjectArea)processServerService.findProcessArea(Pa, null);
String WItype = newWorkItem.getWorkItemType();
IWorkItemType workItemType = workItemServer.findCachedWorkItemType(projectArea, WItype);
IWorkItem workItem = workItemServer.createWorkItem2(workItemType);
// Set the Attributes of Task work item.
workItem.setHTMLSummary(XMLString.createFromPlainText("Automatic WI"));
workItem.setOwner(newWorkItem.getOwner());
workItem.setCategory(newWorkItem.getCategory());
workItem.setTarget(newWorkItem.getTarget());
workItemServer.saveWorkItem3(workItem, null, null, null);
}
page 2of 1 pagesof 2 pages
Comments
Nikhil Bharti
Nov 27 '12, 8:04 a.m.Hey Muthu,
Muthukumar C
Nov 27 '12, 8:15 a.m.Nik, I am not suppose to publish the code as per my company policy.
But i am sure that by reading all the previous discussion between me and sam, you can get a overview of the process.