It's all about the answers!

Ask a question

Difference between modified & lastChangeDate of a Changeset


Shiva Tiwari (1717) | asked Mar 19 '18, 7:43 a.m.
edited Mar 19 '18, 2:22 p.m.

 Hi ,I am using RTC  Enterprise version 6.0.4.

 
I was going through the attributes of a changeset and I am having doubt in these 2 attributes :

lastChangeDate : changeset last modified date until the changeset is not marked as 'Complete'.
modifed  : if we make any changes to a changeset even after delivering a changeset. I found that we can modify a changeset comment even If I have delivered it, that changes the modified attribute of the changeset.

Am I correct ? If a changeset comment can be modified then what other attributes we can modify in a changet , once we have delivered it , which modify modified date attribute of it ?

Also I can't find any official documentation which explains them . 



 

Accepted answer


permanent link
David Lafreniere (4.8k7) | answered Mar 26 '18, 10:07 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

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).

Shiva Tiwari selected this answer as the correct answer

Comments
Shiva Tiwari commented Mar 28 '18, 5:13 a.m.

 @David Lafreniere , Thanks for the response.Just have few more doubts :

Yeah , I read the java doc for the API , but that doesn't mention which all modifications made on a changeset changes the modified date of a changeset. So when a changeset is marked as complete and  after that If I deliver it , will that changeset the modified date of it ?I checked that it's not happening . It doesn't modify the modified date of changeset. Am I correct ?In ChangesetSearchCriteria search query works on the lastChangeDate of it , right ?Actually I have done a poc for that but have few doubts.


1
David Lafreniere commented Mar 28 '18, 11:02 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

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)

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.