TL;DR: I want to run a script in scriptrunner to set the Resolved date to be the same as the timestamp of the last comment made on an issue, but am not very experienced with scriptrunner.
Background:
Recently we did a large migration from Zendesk to Jira Service Management and imported ~30k issues to JSM.
The "Closed" issues that were imported had no resolution set, which broke our ability to look at created / resolved trends for issues migrated from Zendesk to JSM. Missing the resolution, they also appeared to not be properly closed.
The resolution was set to Done via scriptrunner, but this had the adverse outcome of having all closed issues Resolved date set to be the date the resolution was added, so we have a massive Resolved spike on one day of ~28k issues.
Since we do not have any actual data for Closed Date or Resolved Date from Zendesk, I've come to the conclusion that using the latest Comment date is a good enough approximation of what the Resolved date should be, since we are looking at monthly trends, the date doesn't have to be 100% accurate.
I am however not very experienced in scriptrunner.
Has anybody come across a similar challenge to this and able to help?
Thank you