It's all about the answers!

Ask a question

Work Item Creation from Server Side Plugin.


Muthukumar C (32712833) | asked May 29 '12, 3:29 a.m.
retagged Jun 08 '12, 9:34 a.m. by Evan Hughes (2.4k1318)
Hi,

My requirement is that when changing the Status of a Particular Work item, I want to create a new work item in another project area.

I am using JAVA and I have to develop this functionality in SERVER SIDE PLUGIN

Any ideas / sample codes will help me .

Thanks.
Muthukumar.C

Comments
Nikhil Bharti commented Nov 27 '12, 8:04 a.m.

Hey Muthu,


I've same requirement , where I need to create WI of type Task in different project area and copy summary and description fron current workItem.Could you please send me the sample code.

Thanks,
Nik 


Muthukumar C commented 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.

Accepted answer


11 other answers



permanent link
sam detweiler (12.5k6195201) | answered Jun 08 '12, 6:02 p.m.
great!.. thanks for the feedback

permanent link
Dnyanesh Markad (291825) | answered Feb 13 '13, 11:37 p.m.
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);
                               
                                }

Comments
Muthukumar C commented Feb 13 '13, 11:55 p.m.

With the initial glance, the difference is that I am using SaveWorkItem2 functional. apart from that same logic as yours. Should work. 

Your answer


Register or 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.