Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nickname55/a3b5ba916320c9e5b2b9edf220d16a25 to your computer and use it in GitHub Desktop.
Save nickname55/a3b5ba916320c9e5b2b9edf220d16a25 to your computer and use it in GitHub Desktop.
Custome Field - Number field - Script Runner
import com.atlassian.jira.issue.attachment.Attachment;
import com.atlassian.jira.issue.AttachmentManager;
import com.atlassian.jira.component.ComponentAccessor;
AttachmentManager attachmentManager = ComponentAccessor.getAttachmentManager();
List<Attachment> attachments = attachmentManager.getAttachments(issue);
long size = 0l;
for (Attachment at:
attachments) {
size += at.getFilesize();
}
return size;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment