It's all about the answers!

Ask a question

Publishing workitems in build result


Baris Erdemir (1812819) | asked Mar 18 '11, 1:18 p.m.
Hi,
I have a work item reference and build result reference in a build request participant. I am trying to include workitems to build result's, Contrubition Summary/Work items section. I am trying the following api but this does not work. Can you please help me about the appropriate API?

ILink newLink = ILinkFactory.INSTANCE.createLink("com.ibm.team.build.linktype.includedWorkItems", buildResultReference, workItemRef);

Thanks,

One answer



permanent link
Nick Edgar (6.5k711) | answered Mar 21 '11, 11:59 a.m.
JAZZ DEVELOPER
Hi Baris,

The "Included in build" work item references are actually maintained in 2 different representations:
1) as includedWorkItems links
2) as a fixedWorkItems contribution to the build result, which has a content blob listing the work item UUIDs

The Eclipse UI for the "Work items" link in the build result editor is driven off of (2). (1) is there to let the build reference appear in the work item. (1) is also used in the Build web UI to show the work items for the build, but it should really use (2) like the Eclipse UI.

To see how this works for the Jazz SCM participant in JBE, see the source for:
com.ibm.team.build.internal.engine.JazzScmPreBuildParticipant.performAccept(BuildWorkspaceDescriptor, String, IBuildResultHandle, ITeamRepository, IProgressMonitor)
which does:

WorkItemPublisher workItemPublisher = new WorkItemPublisher();

workItemPublisher.publish(resultHandle, acceptReport.getAcceptChangeSets(), teamRepository);

The WorkItemPublisher queries for the work items associated with the accepted change sets, then publishes those in:
com.ibm.team.build.internal.publishing.WorkItemPublisher.publish(IBuildResultHandle, IWorkItemHandle[], ITeamRepository)
This creates the regular links and also uses:
com.ibm.team.build.internal.client.workitem.WorkItemHelper.setFixedInBuild(ITeamRepository, IBuildResultHandle, IWorkItemHandle[])
to create the build result contribution I mentioned.

WorkItemHelper also has:
IWorkItemHandle[] getFixedInBuild(ITeamRepository, IBuildResultHandle, IProgressMonitor)
for getting the work items out of the contribution(s).

You can have a look at the source for WorkItemPublisher and WorkItemHelper for more details.

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.