Skip to main content
Book your demo
Example scripts
To homepage
Jira
Cloud icon
Cloud

Show Last Comment for a Work Item in Jira Cloud

Features
Listeners
Created 2 year(s) ago, Updated 8 day(s) ago
App in script
ScriptRunner For Jira
ScriptRunner For Jira
by Adaptavist
Compatibility
compatibility bullet
Jira
Language |
groovy
final lastCommentFieldName = 'Last Comment'
def myWorkItem = WorkItems.getByKey(issue.key)

myWorkItem.update {
    setCustomFieldValue(lastCommentFieldName, myWorkItem.getComments().last().body)
}
Having an issue with this script?
Report it here