Forums

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

How to display attachment in Scripted field

Hardik Parekh
Contributor
September 7, 2020

Hi All,

I wanted to display last comment of ticket in JQL search, it is reflecting latest comment but attachment is not reflecting.

It is reflecting attachment like below in JQL display

!Attachment_1.png!

 

.scripted-field-attachment.PNG

 

Here is the code I am using

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)

comment.body + "\n" + "Author: " + comment.authorFullName

0 answers

Suggest an answer

Log in or Sign up to answer