Example scripts
To homepage
Jira

Display the Latest Comment Posted by the Currently Logged In User
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira (8.5 - 8.22)

ScriptRunner For Jira (8.53.0)
Language |
groovy
import com.atlassian.jira.component.ComponentAccessor
def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def rendererManager = ComponentAccessor.rendererManager
def commentManager = ComponentAccessor.commentManager
def comments = commentManager.getComments(issue)
def filteredComments = comments.findAll {
it.authorApplicationUser == loggedInUser
}
if (filteredComments) {
def latestComment = filteredComments.last()
rendererManager.getRenderedContent('atlassian-wiki-renderer', "${latestComment.authorApplicationUser.username}\n${latestComment.body}",
issue.issueRenderContext)
}
Having an issue with this script?
Report it here