We have a commonly used script runner field called Last Comment that no longer works after our most recent update to Jira.
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.comments.Comment
import com.atlassian.jira.issue.comments.CommentManager
import com.atlassian.jira.component.ComponentAccessor
def commentManager = ComponentAccessor.getCommentManager()
def comment = commentManager.getLastComment (issue)
def date = comment.getCreated()
return ((date as String) + " " + comment.body + "<br> Author: " + comment.authorFullName)<span>import</span> <span>com.atlassian.jira.ComponentManager<br></span>
We have already discovered that the first import no longer works and must be replaced with
<span>import</span> <span>com.atlassian.jira.component.pico.ComponentManager</span>
But that breaks other parts of the code. Can anyone help with the new code or where to find what needs changed?