Jelly Create attachment error: unable to make temporary copy of file

Jelly script file attachment error: Unable to make temporary copy of file: java.io.PrintWriter@7ad91818

I have tried:

1. back-slash and forward slash in the path

2. checked the file permissions

3. changed the file locations and finally changed the computer.

I get the same error everywhere.

I know that there is another question: https://answers.atlassian.com/questions/39717/issue-in-attachment-creation-in-jira-using-jelly but that is yet unanswered.

I can create a defect manually and attach the same files in the manually created defects, but it fails in Jelly script.

Can anyone shed some light on this issue?

1 answer

1 accepted

0 votes
Accepted answer

I get this error too. It's always because I've got the path wrong on the file. Could you show us two things please?

  • The line of Jelly doing the import
  • The physical location of the file on the server running Jira (full path and name)

I tried:

<jira:AttachFile key="${key}" filepath="E:/Template/Bug.jpg" option="override"/>

then this:

<jira:AttachFile key="${key}" filepath="E:\Template\Bug.jpg" option="override"/>

I got the same error:

Exception: org.apache.commons.jelly.JellyTagException: null:3:0: Unable to make temporary copy of file.
java.io.PrintWriter@665bfdf8

The location of the file is: E:\Template\Bug.jpg

Ok, the second one looks right to me, but I have a nagging doubt that you might need to escape the backslashes in the path - try E:\\Template\\Bug.jpg

Also, can you check that the user running the Jira service has full read/write access to the Bug.jpg file on the server?

E:\\Template\\Bug.jpg ---Tried this too.

In the 2nd line in your comment: I am running Jelly script from my PC (so I have access rights). And I have System Admin rights in JIRA. Also, I could create a defect manually, with the same file as attachment.

Is manual issue creation any different from Jelly script creation? If so, then what should change: "Reporter"?

I have tried creating a bug first and then adding an attachment- as in a different Jelly script, not in the same one. That fails too. So, I assume it has something to with the access permission. But what could be above SysAdmin?

Ah, hang on, I think you've missed something. I said to check

  • The physical location of the file on the server running Jira (full path and name)

I have a feeling e:\template\bug.jpg is on your machine, and not the server? The files you are trying to attach must be on the Jira server.

@Nic: So, the real issue was "file on the server". Yes, I did miss that. I think my problem is solved now. Thank you.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in United States

Topic Tuesday: What's your favorite topic?

Good morning All, Our goal is to get you into the habit of while enjoying your favorite morning drink you are checking the NOVA "space" for topics and comments. Your input is really needed and...

50 views 4 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you