Get Last Comments

Jon Kocen February 11, 2020

Need the Last Comment, Script Runner Fields can help.

Create a custom script Script Runner Field and use this code

import com.atlassian.jira.component.ComponentAccessor

def commentManager = ComponentAccessor.getCommentManager()
def comment = commentManager.getLastComment(issue)

// check to see if comments exist - return comment body if so
if (comment != null) {
return comment.body
}

return null

It returns the last comment and can be used as a field in dashboards.

I found this in an older JIRA community post, but don't remember where exactly so I can't give proper credit -thank you for who ever created this.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events