Adding work items to build result using API
My build result gets links to: changes, snapshot & workspace,
The work items gets a nice link "Included in builds" but my build result does not show the work items as "included in build".
Any ideas why this happens? Is there another way you should add work items to a build result?
Any ideas / thoughts?
Thanks a lot!
/Morten
Accepted answer
String[] handleIds = new String[workItemHandles.length];
for (int i = 0; i < workItemHandles.length; i++) {
handleIds[i] = workItemHandles[i].getItemId().getUuidValue();
}
IBuildResultContribution contribution = BuildItemFactory.createBuildResultContribution();
contribution.setExtendedContributionTypeId(WorkItemConstants.EXTENDED_DATA_TYPE_ID);
contribution.setExtendedContributionData(ContentUtil.stringArrayToContent(teamRepository, handleIds,
EXTENDED_DATA_DELIMITER));
return ClientFactory.getTeamBuildClient(teamRepository).addBuildResultContribution(buildResultHandle,
contribution, IBuildResult.PROPERTIES_COMPLETE, null);
Comments
NICE NICE NICE!!! :-D. If this works, I'm totally gonna give you a medal :-D. I'll report back when I've tried this out. It seems very much like the code I'm using for adding workspace and snapshot contributions, so I cannot see why it should not work!
Thanks!
One question, do you know what the EXTENDED_DATA_DELIMITER is?
I found that it was char '\n'. But if you can supply the place where I can get this constant, it would really help me.
Though it looks like this is an internal constant in your class seeing it lacks any qualified name.