Created
          April 20, 2022 21:20 
        
      - 
      
 - 
        
Save nickname55/a3b5ba916320c9e5b2b9edf220d16a25 to your computer and use it in GitHub Desktop.  
    Custome Field - Number field - Script Runner
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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