It's all about the answers!

Ask a question

How to create new work item from java server side plugin?


pugazhenthi samidurai (26423942) | asked May 23 '12, 6:37 a.m.
Hi,

i want to create work item from server side plugin.

I am using java.

is there any guide or given me a snippet of code.


Thanks in Advance.

Accepted answer


permanent link
Antonio Bonanni (1111717) | answered Jun 05 '12, 5:31 a.m.
edited Jun 05 '12, 5:34 a.m.
IWorkItemServer workitemServer = (IWorkItemServer) getService(IWorkItemServer.class);
.....
.....
.....
workItemServer.saveWorkItem2(targetWorkItem, null, "Open");

or read this post

Hope this help

Cheers


Ralph Schoon selected this answer as the correct answer

One other answer



permanent link
sam detweiler (12.5k6195201) | answered May 23 '12, 8:45 a.m.
not a snippet..
1. you have to do this from a Participant, NOT and Advisor.. an Advisor cannot modify the environment.

but, there are not very many public apis

do you want with or without the UI (u see the UI when u pick Workitem, create)..

with the UI
com.ibm.team.workitem.rcp.ui.createWorkitem().
you will probably have to use internal classes to create the supporting elements for this method.

without the UI is harder.. there are no exposed class methods,
so you will have to take a risk that these will not change too often.

you'll probably need classes in com.ibm.team.workitem.common and com.ibm.team.repository.service.common.

I have modified a some of this code in the process of trying to built general enhancements, but not attempted to add external code to do the tasks you asked about.

you can see the code in the plugins when using eclipse. Use the plugins view, right click on a plugin, import as source.

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.