How to create new work item from java server side plugin?
Accepted answer
IWorkItemServer workitemServer = (IWorkItemServer) getService(IWorkItemServer.class);
.....
.....
.....
workItemServer.saveWorkItem2(targetWorkItem, null, "Open");
or read this post
Hope this help
Cheers
One other answer
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.
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.