Hi,
I am attempting to use a Scripted Field to list all of the Attachments from all Linked issues.
I'm not sure how to get the information from the Linked Issues.
Here is the Code:
import com.atlassian.jira.issue.attachment.Attachment;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.bc.project.ProjectService;
def commentManager = ComponentAccessor.commentManager
def projectService = ComponentAccessor.getComponent(ProjectService)
def attachmentManager = ComponentAccessor.getAttachmentManager()
def numberAttachments = attachmentManager.getAttachments(issue).size()
String s = "";
if(null != attachmentManager.getAttachments(issue))
{
for(Attachment att : issue.attachments)
{
s = s +"<a href=\"" + "/secure/attachment/"+att.id+"/"+att.filename+"\">"+att.filename+"</a>" + "<br>";
}
}
return s;Here is a Mock up Of what I would like to show in the Main Ticket. The field will show Clickable URL links to all attachments from the linked issues
Scripted Fields Attachments on Linked Issues.png
Thanks!