It's all about the answers!

Ask a question

Modifying and saving work item

Anna Wymysłowska (122) | asked Feb 28 '11, 5:53 a.m.
I try to modify a work item that was previously added in jazz. I get IWorkItem object with work item data. Than I would like to modify description, state, attachments and comments.

I use WorkItemInitialization object to modify and save work item:

WorkItemInitialization operation= new WorkItemInitialization(incomingWorkItem, category);

//modifying operation object data
addMissingData(incomingWorkItem, workItem, teamRepository, operation);
IWorkItemHandle handle=, null);
IWorkItem workItem2= auditableClient.resolveAuditable(handle, IWorkItem.FULL_PROFILE, null);
System.out.println("Work item " + workItem2.getId() + " modified.");

private static class WorkItemInitialization extends WorkItemOperation {

//incoming data
private IWorkItem fWorkItem;

private String fDescription;
private String fState;
private ArrayList<File> fAttachments;
private ArrayList<String> fComments;

public WorkItemInitialization(IWorkItem workItem, ICategoryHandle category) {
super("Initializing Work Item");
this.fWorkItem = workItem;

protected void execute(WorkItemWorkingCopy workingCopy, IProgressMonitor monitor) throws TeamRepositoryException {

IWorkItem workItem= workingCopy.getWorkItem();
workItem = this.fWorkItem;

IWorkItem itemCopy = (IWorkItem) workItem.getWorkingCopy();
workItem = itemCopy;

I get an exception while executing:
auditableClient.resolveAuditable(handle, IWorkItem.FULL_PROFILE, null) CRJAZ0215I Item not found: (stateId: <unset>, itemId: , origin:, immutable: <unset>)

Am I doing something wrong while changing work item data or changed work item schould be saved in different way?

One answer

permanent link
Keleh car (6) | answered Mar 02 '11, 4:47 p.m.
HAVE you tried
where are u from rachelek

Your answer

Register or to post your answer.