I am asynchronously putting all comments back to a targeted page. However, the order of comments is not retained when compared with the original page. I am passing history.createdAt and history.lastUpdated at fields, but with no results.
Original Page with comments ordered properly:
<<< Page content >>>
Footer comment
Comment 1 [CreatedAt - Monday - 1/1/2022]
Comment 2 [CreatedAt - Wednesday - 3/1/2022]
Comment 3 [CreatedAt - Saturday - 5/1/2022]
Sample Page after making comments POST call asynchronously and in an unordered manner:
<<< Page content >>>
Footer comment
Comment 3 [CreatedAt - Saturday - 5/1/2022]
Comment 2 [CreatedAt - Wednesday - 3/1/2022]
Comment 1 [CreatedAt - Monday - 1/1/2022]
It seems like confluence is overwriting the createdAt field passed when making a POST call. This results in comments getting restored in a random way.
Is there a way to restore comments in an ordered way, but asynchronously?
Hi @Parth
It wouldn't be possible to restore or add the comments in an ordered way asynchronously.
The reason for that is because the comments does not work like the pages for example, that are possible to be ordered in the UI and placed and moved in the page tree for example.
With that in mind, if you add a comment to a page, it is not possible to change it's location in the hierarchy and there is no "order" location where it can be placed.
In addition to that, the "order" you are trying to get from the history, wouldn't work, as it is read only and would only appear once it is published, not before.
That being said, the only way to guarantee it will be added in the order you want, would be adding it synchronously.
Hope that helps clarifying!
Cheers,
Jessica
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.