Script Validator - check condition or attachment required

Satya Saraboju May 16, 2019

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

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events