Hi,
What kind of Attachments does the ServiceDeskComment interface show and return with getAttachments() method?
I have tested it both for newly added files (Open the Customer Portal, attach the file to the comment, tap on Add button), and existing files (Open issue from Project Queues, open the comment dialogue, select the one of already attached files and tap to Add comment) and it returns an empty list.
Tried to catch from listener on Custom event:
import com.atlassian.jira.component.ComponentAccessor
import org.apache.log4j.Logger;
import com.atlassian.jira.issue.attachment.Attachment
import com.atlassian.jira.issue.AttachmentError
def log = Logger.getLogger("com.onresolve.jira.groovy");
def issue = event.issue;
def comment = event.getComment();
log.debug "comment : " + comment;
def attachment = comment.getAttachments();
and from listener on Issue Commented event:
import com.atlassian.jira.component.ComponentAccessor
import org.apache.log4j.Logger;
import com.atlassian.jira.issue.attachment.Attachment
import com.atlassian.jira.ComponentManager
def log = Logger.getLogger("com.onresolve.jira.groovy");
def issue = event.issue;
Class serviceDeskCommentService = ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.atlassian.servicedesk.api.comment.ServiceDeskCommentService");
def serviceDeskCommentServices = ComponentAccessor.getOSGiComponentInstanceOfType(serviceDeskCommentService);
def comment = event.getComment();
log.debug "comment : " + comment;
def sdComment = serviceDeskCommentServices.getServiceDeskCommentByJiraComment(ComponentAccessor.getUserManager().getUserByName("jiraadmin"), comment);
log.debug "temp : " + sdComment;
But debug returns me result in the following way (attachments empty).
DEBUG [jira.groovy]: comment : com.atlassian.jira.issue.comments.CommentImpl@dbf8cab3
DEBUG [jira.groovy]: temp : Either.Right(ServiceDeskCommentImpl{comment=com.atlassian.jira.issue.comments.CommentImpl@dbf8cab3, attachments=[], isPublic=true})What am I doing wrong?