Hi Team,
I need an Last Comment in the Search Issue Column to export the report file
I have find a add-on instead of buying an add-on is there any way I can do by using the script runner
can you please suggest me regards this .
Thanks,
Kumar
Well, you can use a listener to update a field with last comment.
Edited:
def issue = event.getIssue() as MutableIssue
and
def comment = event.getComment()
You will need some imports also for MutableIssue and to update the value of the field
Hi @Cristian Rosas [Tecnofor] Thanks for your response
Here i understand please correct me if I’m wrong
1st I need to create a custom field called “Last Comment(text field )
2nd script listener and add a custom listener in that I have to add the script that you have provided
if I’m wrong can you please explain more and how to achieve this please
thanks,
kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Cristian Rosas [Tecnofor] I found a script to copy the comments in script filed and i'm adding that scripted filed to Export Report column
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.comments.Comment
import com.atlassian.jira.issue.comments.CommentManager
import com.atlassian.jira.component.ComponentAccessor
def commentManager = ComponentAccessor.getCommentManager()
def comment = commentManager.getLastComment (issue)
def date = comment.getCreated()
return ((date as String) + " " + comment.body)
This script is copying the comment and date that commented I'm just wondering the how can i add the user in the script
I want to copy the user name that who commented as well in the script
Can you please help me how to achieve this
Thanks,
Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey, I've seen you have advanced very well!
Something like this should work:
return ("Commented by " + comment.author + " on " + (date as String) + " " + comment.body)
or
return ("Commented by " + comment.getAuthorFullName() + " on " + (date as String) + " " + comment.body)
Here references:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your response The script I modified an dits working as i expected
here is the script and I need a small help to need thing to work with in the script can you please help me how to do that
import com.atlassian.jira.component.ComponentAccessor
def user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
def commentManager = ComponentAccessor.getCommentManager()
def rendererManager = ComponentAccessor.getRendererManager()
def comments = commentManager.getCommentsForUser(issue, user)
if (comments) {
def commentAuthor = comments.last().getUpdateAuthorFullName()
def commentDate = comments.last().getUpdated()
def commentBody = rendererManager.getRenderedContent("atlassian-wiki-renderer", comments.last().body, issue.issueRenderContext)
return commentBody + "<p><span style=\"font-size:smaller;color:#a9a9a9;font-style:italic\">" + commentDate.format('YYYY-MM-dd') + " | " + commentAuthor + "</span></p>"
}
List of the things to work with script if possibel
can you please tell how to make pass the fail list that i mention above
Thanks,
Kuma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Cristian,
I also want to be able to show the last comment in a report, can you please tell me what is listener that I need to update a field with last comment as you maintained in your answer. I am new in Jira development. What should be installed to get that listener?
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"Last comment" is a calculated field that is available out of the box with the Better Excel Exporter app. You can use it to export the comment text, commenter user, comment date or all to Excel spreadsheets which can be the source of further data transformations.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.