Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3695,7 +3695,7 @@ def enhanced_search_issues(
Total number of results is available in the ``total`` attribute of the returned :class:`ResultList`.
If maxResults evaluates to False, it will try to get all issues in batches. (Default: ``50``)
fields (Optional[Union[str, List[str]]]): comma-separated string or list of issue fields to include in the results.
Default is to include all fields.
Default is to include all fields If you don't require fields, set it to empty string ``''``.
expand (Optional[str]): extra information to fetch inside each resource.
reconcileIssues (Optional[List[int]]): List of issue IDs to reconcile.
properties (Optional[str]): extra properties to fetch inside each result
Expand All @@ -3705,19 +3705,23 @@ def enhanced_search_issues(
Returns:
Union[Dict, ResultList]: JSON Dict if ``json_result=True``, otherwise a `ResultList`.
"""
if isinstance(fields, str):
fields = fields.split(",")
elif fields is None:
if fields is None:
fields = ["*all"]
elif fields and isinstance(fields, str):
fields = fields.split(",")
else:
# this is required only for mypy validation
fields = []
Comment on lines +3713 to +3714
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(non-blocking) in general for these simple comments that don't put us above the line limit, I would push them onto one line, as these comments can get missed and become out of date when not associated with a line of code.

Suggested change
# this is required only for mypy validation
fields = []
fields = [] # help mypy


# this will translate JQL field names to REST API Name
# most people do know the JQL names so this will help them use the API easier
untranslate = {} # use to add friendly aliases when we get the results back
if self._fields_cache:
for i, field in enumerate(fields):
if field in self._fields_cache:
untranslate[self._fields_cache[field]] = fields[i]
fields[i] = self._fields_cache[field]
if fields:
# this will translate JQL field names to REST API Name
# most people do know the JQL names so this will help them use the API easier
if self._fields_cache:
for i, field in enumerate(fields):
if field in self._fields_cache:
untranslate[self._fields_cache[field]] = fields[i]
fields[i] = self._fields_cache[field]

search_params: dict[str, Any] = {
"jql": jql_str,
Expand Down
Loading