It's all about the answers!

Ask a question

How to create a new Work Item


feng jiang (121) | asked May 18 '10, 1:47 a.m.
Hi, I want to create a new Work Item ,but I can not find the java service.Now I can modify and save an existed Work Item like this:
//modify work item name and owner

import com.ibm.team.workitem.service.IWorkItemServer;
import com.ibm.team.foundation.common.text.XMLString;
import com.ibm.team.process.common.IProjectArea;
import com.ibm.team.repository.common.IContributor;
import com.ibm.team.repository.common.IContributorHandle;
import com.ibm.team.repository.common.IItemHandle;
import com.ibm.team.repository.common.TeamRepositoryException;
import com.ibm.team.repository.service.TeamRawService;
import com.ibm.team.workitem.common.model.IWorkItem;

//wI is an existed work item which need modify name and owner

IWorkItem workCopy = (IWorkItem) wI.getWorkingCopy();
XMLString x = XMLString.createFromPlainText("newName");
workCopy.setHTMLSummary(x);

workCopy.setOwner((IContributorHandle) contributor.getItemHandle());

IWorkItemServer wIServer = getService(IWorkItemServer.class);
wIServer.saveWorkItem2(workCopy, null, null);

Now, I wand to know how to create a new work item,thank you.

Be the first one to answer this question!


Register or to post your answer.