-
Notifications
You must be signed in to change notification settings - Fork 704
Closed
Description
Starting from version 3.32.2, the cause of the error disappeared.
For example:
from atlassian import Jira
jira = Jira(
url="https://mysite.com",
username="username",
password="password"
)
fields = {
"summary": "this summary"
}
jira.issue_create(fields)In version 3.32.1 the error text looked like this:
Traceback (most recent call last):
File "...\mwv.py", line 14, in <module>
jira.issue_create(fields)
File "...\.venv\Lib\site-packages\atlassian\jira.py", line 1250, in issue_create
return self.post(url, data={"fields": fields})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\.venv\Lib\site-packages\atlassian\rest_client.py", line 310, in post
response = self.request(
^^^^^^^^^^^^^
File "...\.venv\Lib\site-packages\atlassian\rest_client.py", line 243, in request
self.raise_for_status(response)
File "...\.venv\Lib\site-packages\atlassian\rest_client.py", line 405, in raise_for_status
raise HTTPError(error_msg, response=response)
requests.exceptions.HTTPError: project: project is requiredIn versions after 3.32.1 (and in the current version 3.41.11 too), the error text looks like this:
Traceback (most recent call last):
File "...\mwv.py", line 14, in <module>
jira.issue_create(fields)
File "...\.venv2\Lib\site-packages\atlassian\jira.py", line 1537, in issue_create
return self.post(url, data={"fields": fields})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\.venv2\Lib\site-packages\atlassian\rest_client.py", line 388, in post
response = self.request(
^^^^^^^^^^^^^
File "...\.venv2\Lib\site-packages\atlassian\rest_client.py", line 312, in request
self.raise_for_status(response)
File "...\.venv2\Lib\site-packages\atlassian\rest_client.py", line 549, in raise_for_status
raise HTTPError(error_msg, response=response)
requests.exceptions.HTTPErrorproject: project is required is not printed.
def raise_for_status in the rest_client.py file of the current version (3.41.11)
Open the file at line 539. If we runprint(errors) we get: {'project': 'project is required'}. Note
that the key is a field that is necessary to create a ticket and which is not in the fields variable. However,
on line 541 we do errors.get("message", ""). Of course, inside errors there is no message key, so the
error text errors does not end up in error_msg
Metadata
Metadata
Assignees
Labels
No labels