It's all about the answers!

Ask a question

How to change the creation date of an existing snapshot?

SEC Servizi (97123760) | asked Jul 16 '14, 9:24 a.m.
Is ti possible to change the creation date of an existing snapshot?
ITeamRepository repo = ...
IBaselineSet snapshot = ...
BaselineSet workingCopy = (BaselineSet) snapshot.getWorkingCopy();
IScmClient scmClient = (IScmClient) repo.getClientLibrary(IScmClient.class);     // Anything like this?, null);
Once the working copy has been updated, how can we save the item? We can't find any SCM client library...
We are going to create a lot of snapshot programmatically (from a software migration), but we need to maintain an original date, not the baselineset creation timestamp...
Thanks in advance.

Accepted answer

permanent link
Andrew Niefer (7135) | answered Jul 16 '14, 10:12 a.m.
There is nothing on the client side which will allow you to save modifications to items like this.

Generally speaking, only server side code in the SCM component will be able to modify SCM items.  There is no API to modify the creation date of a snapshot.

Sorry I don't have any suggestions for you.

SEC Servizi selected this answer as the correct answer

SEC Servizi commented Jul 16 '14, 10:21 a.m. | edited Jul 16 '14, 10:23 a.m.
There is no API to modify the creation date of a snapshot.

Not even on server side code, right?

sam detweiler commented Jul 16 '14, 10:27 a.m.

correct.. you would be changing history

Andrew Niefer commented Jul 16 '14, 10:31 a.m.

That is correct.  Baselines and snapshots are generally considered immutable once they are created. The only API to modify a snapshot is for changing the name and comment ( setBaselineSetName and setBaselineSetComment on IScmService).

Your answer

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