How to fetch all the messages in the history section(messages in the image attached) via REST API of Gerrit?
I think you can't get what you want, just the inline comments left in the review.
For example:
curl -user USER:PASS --request GERRIT-SERVER/a/changes/CHANGE-NUMBER/comments | sed 1d | jq --raw-output ".[][] | {Updated: .updated, Message: .message}"
Returns:
{
"Updated": "2021-03-03 12:58:18.000000000",
"Message": "MESSAGE-1"
}
{
"Updated": "2021-03-03 14:13:44.000000000",
"Message": "MESSAGE-2"
}
{
"Updated": "2021-03-03 14:23:05.000000000",
"Message": "MESSAGE-3"
}