Skip to content

Dont replace jira url #1913

Open
Open
@dimanoga

Description

@dimanoga

Bug summary

Hi there,

In our company, API access is provided through a white list system.
To "fix" IP addresses, we use Nginx as a proxy server for accessing Jira.
However, we have noticed that when we use the connection.issuel), in the dictresource method, the URL is replaced with one that Jira returns, rather than the one from which the request originated. Additionally, when updating issues using the issue.update method, the URL used is not the one that the authorization was initiated from, but rather the one provided by the Jira server.

Due to this, when attempting to update a task, we receive a 401 unauthorized error. We are hoping to resolve this issue and ensure that the correct URL is used for all API requests.

Could you please assist us in resolving this issue? We would greatly appreciate any assistance you can provide. Thank you in advance for your attention.

Is there an existing issue for this?

  • I have searched the existing issues

Jira Instance type

Jira Server or Data Center (Self-hosted)

Jira instance version

8.20.0

jira-python version

3.5.2

Python Interpreter version

3.11

Which operating systems have you used?

  • Linux
  • macOS
  • Windows

Reproduction steps

#1 connect to jira via nginx url
connection = JIRA(options={'server':"https://my-nginx.url/', 'verify': False}, auth=(login, pass))
#2 get issue
issue = connection.issue(key='JIRA-1')
#3 try to update issue
issue.update(fields={'description':'test'}) # the url is already used here = jira.company.com

Stack trace

File "/PycharmProjects/portal_back/venv/lib/python3.11/site-packages/jira/resources•py", Line 852, in update
super (). update(async_=async_, jira-jira, notify=notify, fields=data)
File "/PycharmProjects/portal_back/venv/lib/python3.11/site-packages/jira/resources-py", Line 328, in update
r = self._session.put (self.self + querystring, data-json.dumps (data))
Fetur se. euest Por, urt, vtadta, uergs) se-packages/requests/sesstons.py". Line 649, in put.
File "/PycharmProjects/portal_back/venv/lib/python3.11/site-packages/jira/resilientsession-py", line 247, in request elif raise_on_error (response, **processed_kwargs):
File "/PycharmProjects/portal_back/venv/lib/python3.11/site-packages/jira/resilientsession-py", Line 72, in raise_on_error
raise JIRAError(
jira.exceptions.JIRAError: JiraError HTTP 401 url: https://jira.company.com/rest/api/2/issue/15832118
text: You do not have the permission to see the specified issue., Login Required
response headers = {''}
response text = ("errorMessages": ["You do not have the permission to see the specified issue.", "Login Required"], "errors":}}
Process finished with exit code 1

Expected behaviour

The Jira URL has not been replaced, but the one that was used for authorization is still being used,

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions