during issue creation I am trying to check for a condition and if not then make attachment mandatory. Even though an attachment is added it still fails to create issue.
import com.atlassian.jira.component.ComponentAccessor
def attachmentManager = ComponentAccessor.getAttachmentManager()
def numberAttachments = attachmentManager.getAttachments(issue).findAll {a ->a.filename.toLowerCase().endsWith(".pdf")}.size()
return numberAttachments ? numberAttachments as Double : null
cfValues['Job Information']?.value != "Yes" || numberAttachments >0