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 @[deleted]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
Hi @[deleted] 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.ComponentManagerimport com.atlassian.jira.issue.Issueimport com.atlassian.jira.issue.comments.Commentimport com.atlassian.jira.issue.comments.CommentManagerimport 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
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:
https://docs.atlassian.com/software/jira/docs/api/7.2.2/com/atlassian/jira/issue/comments/Comment.html
"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.
See: https://midori-global.com/products/better-excel-exporter-for-jira/server/documentation/customization#calculated-fields
It looks like you're new here. Sign in or register to get started.