Getting the state of the child workitem
(child).
Accepted answer
Hi Dnyanesh, It does work...you're probably missing the definitions in the plugin.xml (in this case, you definitely need the highlighted ones). You'll have to hand-code this in to the plugin.xml - page 59 of the extensions lab doc (v3.0.1) explains.
(btw. see also Nick's comment in here https://jazz.net/forum/questions/70215/fetching-parent-workitem-using-plain-java-api?redirect=%2Fforum%2Fquestions%2F70215%2Ffetching-parent-workitem-using-plain-java-api for a better way to get the work item referenced)
<prerequisites>
<requiredService
interface="com.ibm.team.workitem.service.IWorkItemServer">
</requiredService>
<requiredService
interface="com.ibm.team.build.internal.common.ITeamBuildService">
</requiredService>
<requiredService
interface="com.ibm.team.build.internal.common.ITeamBuildRequestService">
</requiredService>
<requiredService
interface="com.ibm.team.repository.service.IRepositoryItemService">
</requiredService>
<requiredService
interface="com.ibm.team.links.common.service.ILinkService">
</requiredService>
</prerequisites>
3 other answers
I would suggest with reading this post http://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ and then work through the rest of the posts for open questions.
You can also search the forum for API, I think I remember having seen numerous questions and answers with example code around the topics you ask about.
IWorkItemServer workItemService = getService(IWorkItemServer.class);
List<IWorkItem> children = new ArrayList<IWorkItem>();
List<IReference> references= saveParameter.getNewReferences().getReferences(WorkItemEndPoints.CHILD_WORK_ITEMS);
for (IReference reference: references){
String comment = reference.getComment();
String workItemID = comment.substring(0, comment.indexOf(":"));
IWorkItem workItem = workItemService.findWorkItemById(Integer.parseInt(workItemID), IWorkItem.FULL_PROFILE, monitor);
if (workItem.getWorkItemType().equals(requiredWorkitemType)){
children.add(workItem);
}
}
Comments
Hi Sola,