Forums

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

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

Neeraj Kumar August 22, 2013

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
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 22, 2013

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)
Neeraj Kumar August 22, 2013

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

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 22, 2013

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?

Neeraj Kumar August 22, 2013

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?

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 22, 2013

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.

Neeraj Kumar August 26, 2013

@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
TAGS
AUG Leaders

Atlassian Community Events