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

Make search_assignable_users_for_issues function GDPR compliant. #1117

Merged
merged 7 commits into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
18 changes: 15 additions & 3 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2891,12 +2891,13 @@ def search_assignable_users_for_projects(

def search_assignable_users_for_issues(
self,
username: str,
username: Optional[str] = None,
project: Optional[str] = None,
issueKey: Optional[str] = None,
expand: Optional[Any] = None,
startAt: int = 0,
maxResults: int = 50,
query: Optional[str] = None,
):
"""Get a list of user Resources that match the search string for assigning or creating issues.

Expand All @@ -2905,7 +2906,7 @@ def search_assignable_users_for_issues(
assignees, specify an issue key.

Args:
username (str): A string to match usernames against
username (Optional[str]): A string to match usernames against
project (Optional[str]): Filter returned users by permission in this project
(expected if a result will be used to create an issue)
issueKey (Optional[str]): Filter returned users by this issue
Expand All @@ -2914,17 +2915,28 @@ def search_assignable_users_for_issues(
startAt (int): Index of the first user to return (Default: 0)
maxResults (int): maximum number of users to return.
If maxResults evaluates as False, it will try to get all items in batches. (Default: 50)
query (Optional[str]): Search term. It can just be the email.

Returns:
ResultList
"""
params = {"username": username}
if username is not None:
params = {"username": username}
if query is not None:
params = {"query": query}
if project is not None:
params["project"] = project
if issueKey is not None:
params["issueKey"] = issueKey
if expand is not None:
params["expand"] = expand


if not username and not query:
raise ValueError(
"Either 'username' or 'query' arguments must be specified."
)

return self._fetch_pages(
User, None, "user/assignable/search", startAt, maxResults, params
)
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ commands=
python make_local_jira_user.py
python -m pytest {posargs}
setenv =
TWINE_REPOSITORY_URL=https://nelli.khachatryan:AKCp8jR6yFyqZMJRA7mVHZVr65ccx3dWM31YpTAYWWNXvTNvqVQfcDvVZfrjb52z8TyvoqUDY@accolade.jfrog.io/artifactory/api/pypi/pypi-virtual
PIP_CONSTRAINT={toxinidir}/constraints.txt
PIP_LOG={envdir}/pip.log
PIP_DISABLE_PIP_VERSION_CHECK=1
Expand Down