You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hi there,
We are trying to use the APIs /rest/servicedeskapi/servicedesk/{serviceDeskId}/attachTemporaryFile and the servicedeskapi/request/{issueIdOrKey}/attachment.
We get the temporary file ID with `attachTemporaryFile` but then, when we call `attachment` with the ID of the temporary file, we get the following errors:
{‘errorMessage’: ‘There was a problem saving the attachments for this comment’, ‘i18nErrorMessage’: {‘i18nKey’: ‘sd.attachment.temporary.session.time.out.ids’, ‘parameters’: []}}
{‘errorMessage’: ‘An error occurred while processing the attachment. Could not save attachment to storage: Source file does not exist /var/atlassian/jirahomelocal/caches/tmp_attachments/temp1076873519188975551’, ‘i18nErrorMessage’: {‘i18nKey’: ‘sd.attachment.create.error’, ‘parameters’: [‘Could not save attachment to storage: Source file does not exist /var/atlassian/jirahomelocal/caches/tmp_attachments/temp1076873519188975551’]}}
It works after several retries or when we add a sleep function in-between so we think it might by linked to the size of the attachment file and the duration of the upload.
Is there a way to ensure that the file attached is properly uploaded before to trigger servicedeskapi/request/{issueIdOrKey}/attachment ?
Hi @Aymeric Hermant ,
Thanks so much for your question.
There are few scenarios when this can happen. Mainly, when the number of attachments actually created is different from the number of temporary attachment IDs sent.
You have to make sure all the temporary attachments were created correctly before making them permanent attachments.
The other thing is that we have an expiry time for temporary attachments of 1 hour. So you have to make them permanent in that timeframe, otherwise they will be gone and you will see the error in question.
I have previously answered a similar question to yours which might be helpful. Please see here: https://community.atlassian.com/t5/Jira-Service-Management/How-to-add-Attachment-to-Jira-SD-Issue-via-Rest-API/qaq-p/1481185
Thank you,
Artem
Jira Service Management
P.S.: if this answer is correct, please select the ‘accept answer’ button.
We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan. &nb...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.