I am trying to create a groovy script that will attach different files based on a customer field selection. When testing the script, I am getting the following error. I am looking for direction on how to resolve.
There was an error during the execution of your script
com.atlassian.jira.web.util.AttachmentException: Got error while saving attachment Template Test Log Platform Performance.xls: Got exception while saving attachment in attachment store. Exception: https:\confluence.altec.com\display\CON\Design+Assurance+Test+Report+TemplatesTemplate Test Log Platform Performance.xls (The filename, directory name, or volume label syntax is incorrect)
Code:
def bean = new CreateAttachmentParamsBean.Builder()
.file(new File("https://confluence.altec.com/display/CON/Design+Assurance+Test+Report+Templates"+filename))
.filename(filename)
.contentType("text")
.author(currentUser)
.issue(issue)
.build()
ComponentAccessor.attachmentManager.createAttachment(bean)
Hi Matt,
i don’t believe you can pass a URL as the file. The file needs to come from an accessible file system.
You need to first download the file to a temporary location, and then attach that temporary file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.