I have a requirement where I need to track the changes made on page every time it is published on PROD.
I am planning to use PublishInfo of the page and get the timestamp of second last published event.
ArrayOfPublishInfoData info = client.getListPublishInfo(Page.Id);
for (PublishInfoData infoData : info.getPublishInfoData()) {
System.out.println(infoData.getPublishedAt());
}
But above code is returning null against the published date.
After that iterate over the componentpresentation and compare if any particular component is updated after the above timestamp and list it as changes made on the page.
I am using the below event to initiate the business logic:
EventSystem.Subscribe<PublishTransaction, SetPublishStateEventArgs>(InformUsers, EventPhases.TransactionCommitted);
Please let me know if it is a good way or is there any other way to do this?
Thanks