Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Problem on an Workitem Save Participant.

 Hello,

i developed a plugin whose update the state of workitem linked by the predecessor/succesor link.
This plugins works but i have a issue :

the workitems are updated with the good status but the timespent become empty after the exectution of the plugin. I keep the severals entries in the time tracking but the timespent is null.

I use the functions WorkItem.getWorkingCopy() and SaveWokItem2 :

private void updateTestSuccesorWorkitem(IWorkItem workItem, String WorkflowAction, IWorkItemServer workItemServer,
IProgressMonitor monitor) throws TeamRepositoryException {

IWorkItemReferences references = workItemServer.resolveWorkItemReferences(workItem, null);
List<IReference> listSuccesor = references.getReferences(WorkItemEndPoints.SUCCESSOR_WORK_ITEMS);
logger.debug("WorkflowAction = "+ WorkflowAction);
for (IReference reference : listSuccesor) {
if (reference.isItemReference()) {
IWorkItemHandle succesorHandle = (IWorkItemHandle) reference.resolve();
IWorkItem succesor = (IWorkItem) workItemServer
.getAuditableCommon()
.resolveAuditable(succesorHandle, IWorkItem.FULL_PROFILE, monitor)
.getWorkingCopy();
if (succesor.getWorkItemType().equals("test_task")){
//check if the state of predecessor is already on this state (Ready For Testing)
String succesorStateName = getStateName(workItemServer, succesor, monitor);
if (!succesorStateName.equals("Ready For Testing")) {
Identifier <IWorkflowAction> WorkflowActionId = FindActionIdByString(workItemServer, succesor, WorkflowAction, monitor);
logger.debug("this is the WorkflowActionId : " + WorkflowActionId);
IStatus Status = workItemServer.saveWorkItem3(succesor, null, WorkflowActionId.getStringIdentifier(), null);
logger.debug(Status);
}
else {
logger.debug("the task is already on this state - no update");
}
}
}
}
}


Thanks for your help 

0 votes

Comments

what RTC version is this?

 Hi Sam 


It is the RTC-4.0.4

Thanks,
Antoine


Be the first one to answer this question!

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Dec 10 '13, 6:37 a.m.

Question was seen: 3,046 times

Last updated: Dec 10 '13, 7:34 a.m.

Confirmation Cancel Confirm