I have a script to fetch "last updated by" but it doesn't work for comments. Can you help me with the piece of code needs to be added here.
//Code
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
def changeHistoryManager = ComponentAccessor.changeHistoryManager
def userManager = ComponentAccessor.userManager
def changes = changeHistoryManager.getAllChangeItems(issue)
def userKey = changes.sort(false).last().userKey
def user = userManager.getUserByKey(userKey)
def name = user.displayName
return user;
log.error(user.displayName.toString())
Regards,
Ankit Choudhary