How to programmatically check owner of snapshot is set to Stream.
Sanjeev Kulkarni (33●18●23)
| asked Dec 12 '13, 12:34 p.m.
retagged Dec 13 '13, 10:48 a.m. by David Lafreniere (4.8k●7)
I want to verify if build is promoted programmatically.
Requirement: To delete build results that are not released. |
Accepted answer
David Lafreniere (4.8k●7)
| answered Dec 13 '13, 11:00 a.m.
FORUM MODERATOR / JAZZ DEVELOPER edited Dec 13 '13, 11:04 a.m.
Hi Sanjeev.
I'm not sure exactly what you are trying to do, but I can provide some snippets that might be related which you can put together as needed. To get the snapshot contribution of a particular build result: protected IBaselineSet getSnapshotContribution(ITeamRepository teamRepository, IBuildResultHandle buildResultHandle, IProgressMonitor monitor) throws IllegalArgumentException, TeamRepositoryException { IBaselineSet baselineSet = null; ITeamBuildClient client = (ITeamBuildClient) getTeamRepository().getClientLibrary(ITeamBuildClient.class); IBuildResultContribution[] snapshotContribution = client.getBuildResultContributions(buildResultHandle, new String[] { ScmConstants.EXTENDED_DATA_TYPE_ID_BUILD_SNAPSHOT }, monitor); if (snapshotContribution.length > 0) { IBaselineSetHandle baselineSetHandle = (IBaselineSetHandle) snapshotContribution[0].getExtendedContribution(); baselineSet = (IBaselineSet) getTeamRepository().itemManager().fetchCompleteItem(baselineSetHandle, IItemManager.REFRESH, monitor); } return baselineSet; }To check if the owner of the snapshot is a particular stream or workspace:
Sanjeev Kulkarni selected this answer as the correct answer
|
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.