Hello,
I'm in process of migrating a Jira server instance to Jira cloud and would like to move as many ScriptRunner items as possible.
In the server version, I have a workflow condition using Groovy that checks for a changelog with the field='status' and the toValue='To Business Analyst'.
The changelog is checked only if one of our user picker custom fields (Business Analyst) has a value.
If the Business Analyst contains a value and there's no log record of the issue status being changed to 'To Business Analyst', the workflow condition will return false.
In the Jira Expression, I have the check for the Business Analyst value and a check to see if there are existing changelogs. These seem to work fine:
issue.customfield_10041 != null &&
issue.changelogs.length > 0
I can test values in the changelogs as well:
issue.changelogs.filter(c => c.author.displayName == 'Jim').length > 0
I am, however, unable to figure out how to get to the ChangelogItem properties. I've attempted several different approaches based on examples on this page.
Full disclosure, I don't typically do Web development but have been provided an 'opportunity' by having to convert the scripts.
Any help would be appreciated.
Thanks!