Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary api call to /rest/api/2/field #1859

Open
2 of 4 tasks
aneeshco opened this issue May 2, 2024 · 0 comments
Open
2 of 4 tasks

Unnecessary api call to /rest/api/2/field #1859

aneeshco opened this issue May 2, 2024 · 0 comments

Comments

@aneeshco
Copy link

aneeshco commented May 2, 2024

Bug summary

When doing api call using search_issues, it makes two API calls, one GET to the endpoint /rest/api/2/field and another to the actual url /rest/api/2/search. The first api call, returns the whole fields present in the JIRA server environment causing performance issues in the server. This is only done once the first time the function is used. Can this function be updated so that only the /rest/api/2/search is accessed?

issues_page = jira.search_issues(
jql_query,
startAt=start_at,
maxResults=MAX_RESULTS,
validate_query=False,
fields=fields_arg,
expand=None,
properties=None,
use_post=True)

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

9.4.6

jira-python version

3.8

Python Interpreter version

3.11.5

Which operating systems have you used?

  • Linux
  • macOS
  • Windows

Reproduction steps

# 1. Given a Jira client instance
jira: JIRA
# 2. When I call the function with below arguments 
issues_page = jira.search_issues(
                jql_query, 
                startAt=start_at, 
                maxResults=MAX_RESULTS,
                validate_query=False,
                fields=fields_arg,
                expand=None,
                properties=None,
                use_post=True)
# 3. It first calls the field endpoint and then it calls the search endpoint the first time, subsequent times doesnot include calls to field endpoint
# 4. It should only call the search endpoint and not the field endpoint
...

Stack trace

The order of api calls as below when

/rest/api/2/serverInfo - authentication
/rest/api/2/field -  first call to search_issues function
/rest/api/2/search - first call to search_issues function
/rest/api/2/search - second call to search_issues function
/rest/api/2/search - third call to search_issues function
/rest/api/2/search - fourth call to search_issues function

Expected behaviour

Expected behaviour as below
/rest/api/2/serverInfo - authentication
/rest/api/2/search - first call to search_issues function
/rest/api/2/search - second call to search_issues function
/rest/api/2/search - third call to search_issues function
/rest/api/2/search - fourth call to search_issues function

Additional Context

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant