Difference between modified & lastChangeDate of a Changeset
Hi ,I am using RTC Enterprise version 6.0.4.
Accepted answer
The API Javadoc on IChangeSet.getLastChangeDate() says:
* Returns the time in which this change set was last changed in the context of a workspace.
* This timestamp changes when the change set is created, closed or when the nested changes are
* altered in any way. Updating the comment does <b>not</b> update this timestamp.
So when a change is 'open', then every time you check changes into it (or remove/undo them) this 'lastChangeDate' will be update, and in the end, when a change set is closed/completed, the date will be updated one last time, and will never change after that (only these types of changes update the 'lastChangeDate')
There is an IItem.modified() API method, but note that this is on an Item and not a ChangeSet... i.e. almost everything that gets saved to the database is an IItem (ex: IWorkspace, IBaseline, IBuildDefinition, IWorkItem)), and this .modified() value would be updated when new states of this item are saved to the database.
As you correctly indicated, changing the comment on a change set has a new state saved to the database, so the .modified value would be updated, but 'lastChangeDate' would not be updated (per the Javadoc description).
Comments
@David Lafreniere , Thanks for the response.Just have few more doubts :
Delivering, accepting, suspending, resuming will not update the IChangeSet.getLastChangeDate(), as mentioned, only check-ins and the completion of the change set do. Also IChangeSetPropertiesSearchCriteria.setModifiedBefore() for example only considers the IChangeSet.getLastChangeDate(), and not IItem.modified(). So for your use case, you can ignore the IItem.modified() date (which gets updated when any of the properties in IChangeSet has been changed, and saved to the database).
Note: It may appear sometimes that 'delivering' does actually trigger an update of the IChangeSet.getLastChangeDate(), but often this is because the user delivers an 'open' change set, and the act of delivery results in the change set being 'closed' (which causes the .getLastChangeDate() date to change)
1 vote