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
Comments
sam detweiler
Dec 10 '13, 6:43 a.m.what RTC version is this?
Antoine LELEU
Dec 10 '13, 7:34 a.m.Hi Sam