Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to restore footer comments (or comments generally) in same order as they appeared on a page?

Parth June 29, 2022

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?

1 answer

1 vote
Jessica
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 5, 2022

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events