Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Publishing workitems in build result

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,

0 votes



One answer

Permanent link
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.

0 votes

Your answer

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,941

Question asked: Mar 18 '11, 1:18 p.m.

Question was seen: 5,833 times

Last updated: Mar 18 '11, 1:18 p.m.

Confirmation Cancel Confirm