The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.