Hi Team,
I am trying to upload small size txt file into JIRA Issue and below is the python script I am trying to execute.
# ===============
# upload.attachment.py
# ===============
import requests
import json
# [JIRA-BASE-URL], i.e.: http://localhost:8080
# [ISSUE-ID], i.e.: ATT-1
url = '[mycompcorpjiraurl]/jira/rest/api/latest/issue/[issueID]'
headers = {"X-Atlassian-Token": "nocheck"}
# please uncomment to attach external file
files = {'file': open('greetings.txt', 'rb')}
# upload file to issue
r = requests.post(url, auth=('mycompanycorpjiraloginuser', 'mycompanycorpjiraloginpwd'), files=files, headers=headers)
print(r.status_code)
print(r.text)
Response:
500
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an unknown error, possibly due to misconfiguration.
Contact the server administrator: [no address given]<p>
More information about this error may be available
in the server error log.</p>
</body></html>
I had tried java script for which same response is returned. I do not have admin rights to view the logs. Please help.
I think you already forgot the "/attachments" part in your URL ?
This missing thing is irrelevant I believe because it more than likely is a configuration error on the server side.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This error is a server side HTTP status code. 500 and 400s are the most common network errors to return.
The server encountered an unexpected condition which prevented it from fulfilling the request.
Wikipedia
A generic error message, given when no more specific message is suitable.
The general catch-all error when the server-side throws an exception
5xx server side
4xx client side
https://restapitutorial.com/httpstatuscodes.html
I would check with your networking team on that one.
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.