It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to include all comments and last attachment in custom email using script runner?

Hello All,

I am using below script in the email template to get last comment.

Last Comment: <% (transientVars?.comment)
out << transientVars.comment

But how can include all comments in the custom email with comment created date and time?

How can i add last attachment in the email?

Thanks in advance,



1 answer


I think you can get collection with attachments from com.atlassian.jira.issue.Issue interface, there is a method
Collection<Attachment> getAttachments()

Considering comments, have you tried com.atlassian.jira.issue.comments.CommentManager and com.atlassian.jira.issue.comments.Comment interfaces?

There are methods:
In CommentManager:
List<Comment> getComments(Issue issue)
This will return all comments for a given issue.

In Comment
Date getCreated()

Suggest an answer

Log in or Sign up to answer

Community Events

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

Events near you