It's all about the answers!

Ask a question

Problem on an Workitem Save Participant.

Antoine LELEU (5012728) | asked Dec 10 '13, 6:37 a.m.

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
.resolveAuditable(succesorHandle, IWorkItem.FULL_PROFILE, monitor)
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);
else {
logger.debug("the task is already on this state - no update");

Thanks for your help 

sam detweiler commented Dec 10 '13, 6:43 a.m.

what RTC version is this?

Antoine LELEU commented Dec 10 '13, 7:34 a.m. | edited Dec 10 '13, 7:34 a.m.

 Hi Sam 

It is the RTC-4.0.4


Be the first one to answer this question!

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