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

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.

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

0 votes


Accepted answer

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

IWorkspaceManager wkspcMgr = (IWorkspaceManager)repo.getClientLibrary(IWorkspaceManager.class);
wkspcMgr.setName(snapshot, "NewName - " + snapshot.getName(), monitor);
Best,
Arne

Patrick Leyman selected this answer as the correct answer

1 vote

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,938

Question asked: Oct 01 '10, 8:35 a.m.

Question was seen: 4,448 times

Last updated: Jul 29 '14, 3:17 a.m.

Confirmation Cancel Confirm