I'm working with the jira service management rest API to simply submit a customer request on JSD. I am submitting this request using the AWS sam cli in a lambda function.
An attachment is a required field for my request, so I used attachTemporaryFile to get a file id that I can pass to the required field of "attachment", this doesn't result in errors.
I call POST /rest/servicedeskapi/request/{issueIdOrKey}/attachment after my request is created because using a temporary file id in the POST /rest/servicedeskapi/request doesn't show the attachment when I open the ticket on the customer portal.
So I'm using the python requests library to submit a customer request that exists in a service desk, then attach a temporary file to the service desk, and finally attach that temporary file id I get back to the customer request I submitted.
When I call POST /rest/servicedeskapi/request/{issueIdOrKey}/attachment I get a 500 status code with error:
{"errorMessage":"An error occurred while processing the attachment. Could not save attachment to storage: Source file does not exist /var/atlassian/application-data/jira/caches/tmp_attachments/temp5549853747651003221","i18nErrorMessage":{"i18nKey":"sd.attachment.create.error","parameters":["Could not save attachment to storage: Source file does not exist /var/atlassian/application-data/jira/caches/tmp_attachments/temp5549853747651003221"
these are my headers for /rest/servicedeskapi/request/{issueIdOrKey}/attachment:
headers = {
"Authorization": "Bearer <token>",
"X-Atlassian-Token": "no-check",
"X-ExperimentalApi": "opt-in"
}
payload = json.dumps({
"temporaryAttachmentIds": [
"temp5549853747651003221",
],
"public": "true",
"additionalComment": {
"body": "sample body"
}
})
response = requests.request("POST", url=f'<baseUrl>/rest/servicedeskapi/request/{issue_id}/attachment', data=payload, headers=headers)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.