@@ -2891,21 +2891,24 @@ def search_assignable_users_for_projects(
2891
2891
2892
2892
def search_assignable_users_for_issues (
2893
2893
self ,
2894
- username : str ,
2894
+ username : Optional [ str ] = None ,
2895
2895
project : Optional [str ] = None ,
2896
2896
issueKey : Optional [str ] = None ,
2897
2897
expand : Optional [Any ] = None ,
2898
2898
startAt : int = 0 ,
2899
2899
maxResults : int = 50 ,
2900
+ query : Optional [str ] = None ,
2900
2901
):
2901
2902
"""Get a list of user Resources that match the search string for assigning or creating issues.
2903
+ "username" query parameter is deprecated in Jira Cloud; the expected parameter now is "query", which can just be
2904
+ the full email again. But the "user" parameter is kept for backwards compatibility, i.e. Jira Server/Data Center.
2902
2905
2903
2906
This method is intended to find users that are eligible to create issues in a project or be assigned
2904
2907
to an existing issue. When searching for eligible creators, specify a project. When searching for eligible
2905
2908
assignees, specify an issue key.
2906
2909
2907
2910
Args:
2908
- username (str): A string to match usernames against
2911
+ username (Optional[ str] ): A string to match usernames against
2909
2912
project (Optional[str]): Filter returned users by permission in this project
2910
2913
(expected if a result will be used to create an issue)
2911
2914
issueKey (Optional[str]): Filter returned users by this issue
@@ -2914,17 +2917,27 @@ def search_assignable_users_for_issues(
2914
2917
startAt (int): Index of the first user to return (Default: 0)
2915
2918
maxResults (int): maximum number of users to return.
2916
2919
If maxResults evaluates as False, it will try to get all items in batches. (Default: 50)
2920
+ query (Optional[str]): Search term. It can just be the email.
2917
2921
2918
2922
Returns:
2919
2923
ResultList
2920
2924
"""
2921
- params = {"username" : username }
2925
+ if username is not None :
2926
+ params = {"username" : username }
2927
+ if query is not None :
2928
+ params = {"query" : query }
2922
2929
if project is not None :
2923
2930
params ["project" ] = project
2924
2931
if issueKey is not None :
2925
2932
params ["issueKey" ] = issueKey
2926
2933
if expand is not None :
2927
2934
params ["expand" ] = expand
2935
+
2936
+ if not username and not query :
2937
+ raise ValueError (
2938
+ "Either 'username' or 'query' arguments must be specified."
2939
+ )
2940
+
2928
2941
return self ._fetch_pages (
2929
2942
User , None , "user/assignable/search" , startAt , maxResults , params
2930
2943
)
0 commit comments