There were few questions on the community related to using smart values for fetching change history of an issue. It is much easier to use ScriptRunner for Jira Cloud but there is something that can be done using Automation as well.
I would prefer using ScriptRunner as writing a groovy script is easier, a bit more readable and can handle complex cases. In both cases you need this end point.
-
JIRAURL/rest/api/3/issue/{{issue.key}}?expand=changelog
Let us say you want to do it using Automation rules, then when you call this end point. You will get a response JSON back in a smart value which you can access like this.
-
{{webhookResponse.body.changelog.histories}}
Now if you log this smart value you will get the json of the histories part of all the change histories. Now you can further iterate over those list of items in the change histories.
-
{{#webhookResponse.body.changelog.histories}}
-
ID: {{id}}
-
Created: {{created}}
-
{{#items}}{{fromString}} - {{toString}} {{/}}
-
{{/}}
This will give you all the items in the change log like this.
-
ID: 18206
-
Created: 2021-01-02T17:11:59.730+0000
-
To Do - In Progress
-
-
ID: 18152
-
Created: 2021-01-01T16:40:30.859+0000
-
To Do - In Review
I hope it helps.