Hi everyone
We have a considerable amount of large files in our JIRA instance. From 100mb to 1gb.
I wanted to do a query for issues with attachments larger than 100mb, so we can make sure we have the file on our local archive, before deleting it.
We have ScriptRunner installed, so I tried modifying this script to return attachmentSize instead of numbers of attachments, but I can't get it to work.
<span class="hljs-keyword">import</span> com.atlassian.jira.component.ComponentAccessor
def attachmentManager = ComponentAccessor.getAttachmentManager()
def numberAttachments = attachmentManager.getAttachments(issue).size()
<span class="hljs-comment">// use the following instead for number of PDFs</span>
<span class="hljs-comment">//def numberAttachments = attachmentManager.getAttachments(issue).findAll {a -></span>
<span class="hljs-comment">// a.filename.toLowerCase().endsWith(".pdf")</span>
<span class="hljs-comment">//}.size()</span>
<span class="hljs-keyword">return</span> numberAttachments ? numberAttachments as Double : <span class="hljs-keyword">null<br></span>
Does anyone have a suggestion as to how I modify this script? Or another way to get a list of issues with large attachments? (We are running JIRA 6.4)
Thanks for your help,
/Nikolaj