Is it possible to map "mostRecentComment" to a field?

Nicolas Bier August 5, 2015

The variable "mostRecentComment" seems to have been designed for email notification, however we would like to be able to display the most recent comment in a multi-line text field. Is it possible?

1 answer

1 vote
Alejo Villarrubia [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2015

This could be the code of a scripted field:

import com.atlassian.jira.component.ComponentAccessor

def commentManager = ComponentAccessor.getCommentManager()
def comments = commentManager.getComments(issue)
comments ? comments.last().body : null

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events