Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

mani@123
Contributor
September 23, 2019

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,

Mani

 

1 answer

0 votes
fjodors
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2019

Hi

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
TAGS
atlassian, likes for trees, atlassian community, social impact, tree planting campaign, community kudos, atlassian giving, environmental impact, sustainability, likes for good, atlassian social responsibility, community challenge

Make every click count—help us plant 50,000 trees! 🌳

Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!

Help us plant more trees
AUG Leaders

Atlassian Community Events