The Exalate team will be on holiday for the coming days - returning Jan 4
Enjoy & stay safe
1
0
-1
1 answer
- 10-1
Hey, Ron Becker
Thanks for asking on community!
You could do it with||
operator or the array list check:issue.attachments = replica.attachments.findAll { attachment -> attachment.filename.endsWith(".pdf") || attachment.filename.endsWith(".pdf") }
or
issue.attachments = replica.attachments.findAll { attachment -> [".pdf",".txt"].any { ext -> attachment.filename.endsWith(ext) } }
Happy Exalating!
SerhiyAdd your comment...
There is a possibility to limit the attachments imported with the incoming script. The following line works fine.
issue.attachments = replica.attachments.findAll { attachment -> attachment.filename.endsWith(".pdf") }
When we only want to accept .pdf and .txt I changed it into
issue.attachments = replica.attachments.findAll { attachment -> attachment.filename.endsWith(".pdf",".txt") }
unfortunately this gives an error. Is it possible to define multiple file extensions?