I've got a scriptrunner post function firing that I can't get to reliably include a comment that was created in a prior function during the same transition.
My sequence looks like:
My custom email template includes:
<% if (mostRecentComment)
out << "Last comment: " << mostRecentComment
%>
I've tried mostRecentComment, lastComment, and latestPriorComment.
On rare occasion, it will seem to work, leading me to think it's a race condition. To that end, I've tried inserting another custom script post-function after step 8 that does
Thread.start {
Thread.sleep(10000)
}
Any ideas what I'm doing wrong?
This will give you your last comment (if you have any comments)
Try it, without sleep or any other timing involve.
<%
def lastComment = com.atlassian.jira.component.ComponentAccessor.getCommentManager().getLastComment(issue)
if (lastComment != null) {
out << "Last comment: " << lastComment.body
}
%>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.