Modifying a snapshot's name
Hi,
I want to change the name of a snapshot that is attached as a contribution to my build result. I'm able to recover the snapshot (BaselineSet) with the code shown below, but I couldn't find a way to change it's name.
Anyone has an idea?
Thanks in advance,
Patrick
I want to change the name of a snapshot that is attached as a contribution to my build result. I'm able to recover the snapshot (BaselineSet) with the code shown below, but I couldn't find a way to change it's name.
ITeamBuildClient buildClient = (ITeamBuildClient) teamRepository.getClientLibrary(ITeamBuildClient.class);
IBuildResult buildResult = getBuildResult(buildClient, teamRepository, buildResultId, monitor);
IBuildResultContribution[] contribs = ClientFactory.getTeamBuildClient(teamRepository).getBuildResultContributions(buildResult,
ScmConstants.EXTENDED_DATA_TYPE_ID_BUILD_SNAPSHOT, monitor);
if (contribs != null && contribs.length == 1) {
if (contribs[0].getExtendedContribution() instanceof IBaselineSetHandle) {
IBaselineSetHandle baseLineHandle = (IBaselineSetHandle) contribs[0].getExtendedContribution();
IBaselineSet baseline = (IBaselineSet)teamRepository.itemManager().fetchCompleteItem(baseLineHandle, 0, monitor);
...
Anyone has an idea?
Thanks in advance,
Patrick
Accepted answer
Patrick,
even though this question is rather old for completness sake here is the answer, duplicated in https://jazz.net/forum/questions/121007/how-do-i-change-a-snapshots-name-using-the-jazz-plan-java-api :
Arne
even though this question is rather old for completness sake here is the answer, duplicated in https://jazz.net/forum/questions/121007/how-do-i-change-a-snapshots-name-using-the-jazz-plan-java-api :
IWorkspaceManager wkspcMgr = (IWorkspaceManager)repo.getClientLibrary(IWorkspaceManager.class);
wkspcMgr.setName(snapshot, "NewName - " + snapshot.getName(), monitor);
Best,
Arne