It's all about the answers!

Ask a question

automatic status update for the work item “Story


Girish Jangame (1118) | asked Dec 07 '16, 9:29 a.m.
Hi,
I want to implement "When all its children are closed ”then the story becomes closed" this condition

but i unable to get the particular Closed status of the Work Item Story through code.
please anyone help me out for that

Meanwhile i have hard coded the value of state which is present in Process Configuration Source file in java code as
below,

Identifier<IState> array[] =workflowInfo3.getAllStateIds();
for (int i = 0; i < array.length; i++) {
if((String.valueOf(array[i]).equalsIgnoreCase("com.ibm.team.workitem.common.model.IState:com.ibm.team.apt.story.idea")))
{
// We want to modify the parent, so get a working copy.
   parent = (IWorkItem)parent.getWorkingCopy();
// Set the duration on the parent to be the total of child durations
   
parent.setState2(array[i]);
   // Save the work item with an information that could be used to prevent recursive ascent.
   workItemService.saveWorkItem2(parent, null, null);
   break;
}
}


In this code for closed status "com.ibm.team.workitem.common.model.IState:com.ibm.team.apt.story.idea"
This Id is present in Process Configuration Source file.

But I want to get it from code instead of writing it as above.

Please help me out.

One answer



permanent link
Ralph Schoon (63.2k33646) | answered Dec 07 '16, 9:49 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Dec 07 '16, 9:53 a.m.
 Find some hints here: https://rsjazz.wordpress.com/2012/11/27/resolve-parent-if-all-children-are-resolved-participant/ and here: https://rsjazz.wordpress.com/2012/11/26/manipulating-work-item-states/

Your answer


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.