We have a commonly used script runner field called Last Comment that no longer works after our most recent update to Jira.
import com.atlassian.jira.ComponentManagerimport com.atlassian.jira.issue.Issue
def commentManager = ComponentAccessor.getCommentManager()
def comment = commentManager.getLastComment (issue)
def date = comment.getCreated()
return ((date as String) + " " + comment.body + "<br> Author: " + comment.authorFullName)
We have already discovered that the first import no longer works and must be replaced with
But that breaks other parts of the code. Can anyone help with the new code or where to find what needs changed?
While I don't have Jira 8 yet ... the ComponentManager has been deprecated for a long time.
And you don't seem to be using it anywhere in your script. Probably just some leftover.
I suspect the following simplified script will work just fine with identical results:
def comment = ComponentAccessor.commentManager.getLastComment(issue)
"$comment.created $comment.body <br> Author: $comment.authorFullName"
Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events