Skip to content

Commit

Permalink
Get the properties when fetching and searching an Issue (#1605)
Browse files Browse the repository at this point in the history
* Get the properties when fetching an Issue

* Get the properties when searching for issues
  • Loading branch information
turran committed Feb 7, 2023
1 parent 16b90f5 commit f7d8962
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1444,13 +1444,15 @@ def issue(
id: Union[Issue, str],
fields: Optional[str] = None,
expand: Optional[str] = None,
properties: Optional[str] = None,
) -> Issue:
"""Get an issue Resource from the server.
Args:
id (Union[Issue, str]): ID or key of the issue to get
fields (Optional[str]): comma-separated string of issue fields to include in the results
expand (Optional[str]): extra information to fetch inside each resource
properties (Optional[str]): extra properties to fetch inside each result
Returns:
Issue
"""
Expand All @@ -1465,6 +1467,8 @@ def issue(
params["fields"] = fields
if expand is not None:
params["expand"] = expand
if properties is not None:
params["properties"] = properties
issue.find(id, params=params)
return issue

Expand Down Expand Up @@ -3034,6 +3038,7 @@ def search_issues(
validate_query: bool = True,
fields: Optional[Union[str, List[str]]] = "*all",
expand: Optional[str] = None,
properties: Optional[str] = None,
json_result: bool = False,
) -> Union[Dict[str, Any], ResultList[Issue]]:
"""Get a :class:`~jira.client.ResultList` of issue Resources matching a JQL search string.
Expand All @@ -3048,6 +3053,7 @@ def search_issues(
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.
expand (Optional[str]): extra information to fetch inside each resource
properties (Optional[str]): extra properties to fetch inside each result
json_result (bool): JSON response will be returned when this parameter is set to True.
Otherwise, :class:`~jira.client.ResultList` will be returned.
Expand Down Expand Up @@ -3075,6 +3081,7 @@ def search_issues(
"validateQuery": validate_query,
"fields": fields,
"expand": expand,
"properties": properties,
}
if json_result:
search_params["maxResults"] = maxResults
Expand Down

0 comments on commit f7d8962

Please sign in to comment.