• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tylernathanreed / jira-client-php / 13678007438

05 Mar 2025 02:15PM UTC coverage: 2.081% (+0.01%) from 2.067%
13678007438

push

github

tylernathanreed
Merge branch 'master' of github.com:tylernathanreed/jira-client-php

141 of 6775 relevant lines covered (2.08%)

0.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Operations/UserSearch.php
1
<?php
2

3
namespace Jira\Client\Operations;
4

5
use Jira\Client\Client;
6
use Jira\Client\Schema;
7

8
/** @phpstan-require-extends Client */
9
trait UserSearch
10
{
11
    /**
12
     * Returns a list of users who can be assigned issues in one or more projects.
13
     * The list may be restricted to users whose attributes match a string
14
     * 
15
     * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and then returns only the users from that range that can be assigned issues in the projects.
16
     * This means the operation usually returns fewer users than specified in `maxResults`.
17
     * To get all the users who can be assigned issues in the projects, use "Get all users" and filter the records in your code
18
     * 
19
     * Privacy controls are applied to the response based on the users' preferences.
20
     * This could mean, for example, that the user's email address is hidden.
21
     * See the "Profile visibility overview" for more details
22
     * 
23
     * This operation can be accessed anonymously
24
     * 
25
     * **"Permissions" required:** None.
26
     * 
27
     * @link https://developer.atlassian.com/cloud/jira/platform/profile-visibility/
28
     * 
29
     * @param string $projectKeys A list of project keys (case sensitive).
30
     *                            This parameter accepts a comma-separated list.
31
     * @param string $query A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users.
32
     *                      The string can match the prefix of the attribute's value.
33
     *                      For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*.
34
     *                      Required, unless `accountId` is specified.
35
     * @param string $username This parameter is no longer available.
36
     *                         See the "deprecation notice" for details.
37
     *                         @link https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide
38
     * @param string $accountId A query string that is matched exactly against user `accountId`.
39
     *                          Required, unless `query` is specified.
40
     * @param int $startAt The index of the first item to return in a page of results (page offset).
41
     * @param int $maxResults The maximum number of items to return per page.
42
     * 
43
     * @return list<Schema\User>
44
     */
45
    public function findBulkAssignableUsers(
×
46
        string $projectKeys,
47
        ?string $query = null,
48
        ?string $username = null,
49
        ?string $accountId = null,
50
        ?int $startAt = 0,
51
        ?int $maxResults = 50,
52
    ): array {
53
        return $this->call(
×
54
            uri: '/rest/api/3/user/assignable/multiProjectSearch',
×
55
            method: 'get',
×
56
            query: compact('projectKeys', 'query', 'username', 'accountId', 'startAt', 'maxResults'),
×
57
            success: 200,
×
58
            schema: [Schema\User::class],
×
59
        );
×
60
    }
61

62
    /**
63
     * Returns a list of users that can be assigned to an issue.
64
     * Use this operation to find the list of users who can be assigned to:
65
     * 
66
     *  - a new issue, by providing the `projectKeyOrId`
67
     *  - an updated issue, by providing the `issueKey` or `issueId`
68
     *  - to an issue during a transition (workflow action), by providing the `issueKey` or `issueId` and the transition id in `actionDescriptorId`.
69
     * You can obtain the IDs of an issue's valid transitions using the `transitions` option in the `expand` parameter of " Get issue"
70
     * 
71
     * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue.
72
     * The user is returned in the response if they can be assigned to the issue or issue transition
73
     * 
74
     * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and then returns only the users from that range that can be assigned the issue.
75
     * This means the operation usually returns fewer users than specified in `maxResults`.
76
     * To get all the users who can be assigned the issue, use "Get all users" and filter the records in your code
77
     * 
78
     * Privacy controls are applied to the response based on the users' preferences.
79
     * This could mean, for example, that the user's email address is hidden.
80
     * See the "Profile visibility overview" for more details
81
     * 
82
     * **"Permissions" required:** *Browse users and groups* "global permission" or *Assign issues* "project permission"
83
     * 
84
     * @link https://developer.atlassian.com/cloud/jira/platform/profile-visibility/
85
     * @link https://confluence.atlassian.com/x/x4dKLg
86
     * @link https://confluence.atlassian.com/x/yodKLg
87
     * 
88
     * @param string $query A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant users.
89
     *                      The string can match the prefix of the attribute's value.
90
     *                      For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*.
91
     *                      Required, unless `username` or `accountId` is specified.
92
     * @param string $sessionId The sessionId of this request.
93
     *                          SessionId is the same until the assignee is set.
94
     * @param string $username This parameter is no longer available.
95
     *                         See the "deprecation notice" for details.
96
     *                         @link https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide
97
     * @param string $accountId A query string that is matched exactly against user `accountId`.
98
     *                          Required, unless `query` is specified.
99
     * @param string $project The project ID or project key (case sensitive).
100
     *                        Required, unless `issueKey` or `issueId` is specified.
101
     * @param string $issueKey The key of the issue.
102
     *                         Required, unless `issueId` or `project` is specified.
103
     * @param string $issueId The ID of the issue.
104
     *                        Required, unless `issueKey` or `project` is specified.
105
     * @param int $startAt The index of the first item to return in a page of results (page offset).
106
     * @param int $maxResults The maximum number of items to return.
107
     *                        This operation may return less than the maximum number of items even if more are available.
108
     *                        The operation fetches users up to the maximum and then, from the fetched users, returns only the users that can be assigned to the issue.
109
     * @param int $actionDescriptorId The ID of the transition.
110
     * @param bool $recommend 
111
     * 
112
     * @return list<Schema\User>
113
     */
114
    public function findAssignableUsers(
×
115
        ?string $query = null,
116
        ?string $sessionId = null,
117
        ?string $username = null,
118
        ?string $accountId = null,
119
        ?string $project = null,
120
        ?string $issueKey = null,
121
        ?string $issueId = null,
122
        ?int $startAt = 0,
123
        ?int $maxResults = 50,
124
        ?int $actionDescriptorId = null,
125
        ?bool $recommend = false,
126
    ): array {
127
        return $this->call(
×
128
            uri: '/rest/api/3/user/assignable/search',
×
129
            method: 'get',
×
130
            query: compact('query', 'sessionId', 'username', 'accountId', 'project', 'issueKey', 'issueId', 'startAt', 'maxResults', 'actionDescriptorId', 'recommend'),
×
131
            success: 200,
×
132
            schema: [Schema\User::class],
×
133
        );
×
134
    }
135

136
    /**
137
     * Returns a list of users who fulfill these criteria:
138
     * 
139
     *  - their user attributes match a search string
140
     *  - they have a set of permissions for a project or issue
141
     * 
142
     * If no search string is provided, a list of all users with the permissions is returned
143
     * 
144
     * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and then returns only the users from that range that match the search string and have permission for the project or issue.
145
     * This means the operation usually returns fewer users than specified in `maxResults`.
146
     * To get all the users who match the search string and have permission for the project or issue, use "Get all users" and filter the records in your code
147
     * 
148
     * Privacy controls are applied to the response based on the users' preferences.
149
     * This could mean, for example, that the user's email address is hidden.
150
     * See the "Profile visibility overview" for more details
151
     * 
152
     * This operation can be accessed anonymously
153
     * 
154
     * **"Permissions" required:**
155
     * 
156
     *  - *Administer Jira* "global permission", to get users for any project
157
     *  - *Administer Projects* "project permission" for a project, to get users for that project.
158
     * 
159
     * @link https://developer.atlassian.com/cloud/jira/platform/profile-visibility/
160
     * @link https://confluence.atlassian.com/x/x4dKLg
161
     * @link https://confluence.atlassian.com/x/yodKLg
162
     * 
163
     * @param string $permissions A comma separated list of permissions.
164
     *                            Permissions can be specified as any:
165
     *                             - permission returned by "Get all permissions"
166
     *                             - custom project permission added by Connect apps
167
     *                             - (deprecated) one of the following:
168
     *                                
169
     *                                 - ASSIGNABLE\_USER
170
     *                                 - ASSIGN\_ISSUE
171
     *                                 - ATTACHMENT\_DELETE\_ALL
172
     *                                 - ATTACHMENT\_DELETE\_OWN
173
     *                                 - BROWSE
174
     *                                 - CLOSE\_ISSUE
175
     *                                 - COMMENT\_DELETE\_ALL
176
     *                                 - COMMENT\_DELETE\_OWN
177
     *                                 - COMMENT\_EDIT\_ALL
178
     *                                 - COMMENT\_EDIT\_OWN
179
     *                                 - COMMENT\_ISSUE
180
     *                                 - CREATE\_ATTACHMENT
181
     *                                 - CREATE\_ISSUE
182
     *                                 - DELETE\_ISSUE
183
     *                                 - EDIT\_ISSUE
184
     *                                 - LINK\_ISSUE
185
     *                                 - MANAGE\_WATCHER\_LIST
186
     *                                 - MODIFY\_REPORTER
187
     *                                 - MOVE\_ISSUE
188
     *                                 - PROJECT\_ADMIN
189
     *                                 - RESOLVE\_ISSUE
190
     *                                 - SCHEDULE\_ISSUE
191
     *                                 - SET\_ISSUE\_SECURITY
192
     *                                 - TRANSITION\_ISSUE
193
     *                                 - VIEW\_VERSION\_CONTROL
194
     *                                 - VIEW\_VOTERS\_AND\_WATCHERS
195
     *                                 - VIEW\_WORKFLOW\_READONLY
196
     *                                 - WORKLOG\_DELETE\_ALL
197
     *                                 - WORKLOG\_DELETE\_OWN
198
     *                                 - WORKLOG\_EDIT\_ALL
199
     *                                 - WORKLOG\_EDIT\_OWN
200
     *                                 - WORK\_ISSUE
201
     * @param string $query A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users.
202
     *                      The string can match the prefix of the attribute's value.
203
     *                      For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*.
204
     *                      Required, unless `accountId` is specified.
205
     * @param string $username This parameter is no longer available.
206
     *                         See the "deprecation notice" for details.
207
     *                         @link https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide
208
     * @param string $accountId A query string that is matched exactly against user `accountId`.
209
     *                          Required, unless `query` is specified.
210
     * @param string $issueKey The issue key for the issue.
211
     * @param string $projectKey The project key for the project (case sensitive).
212
     * @param int $startAt The index of the first item to return in a page of results (page offset).
213
     * @param int $maxResults The maximum number of items to return per page.
214
     * 
215
     * @return list<Schema\User>
216
     */
217
    public function findUsersWithAllPermissions(
×
218
        string $permissions,
219
        ?string $query = null,
220
        ?string $username = null,
221
        ?string $accountId = null,
222
        ?string $issueKey = null,
223
        ?string $projectKey = null,
224
        ?int $startAt = 0,
225
        ?int $maxResults = 50,
226
    ): array {
227
        return $this->call(
×
228
            uri: '/rest/api/3/user/permission/search',
×
229
            method: 'get',
×
230
            query: compact('permissions', 'query', 'username', 'accountId', 'issueKey', 'projectKey', 'startAt', 'maxResults'),
×
231
            success: 200,
×
232
            schema: [Schema\User::class],
×
233
        );
×
234
    }
235

236
    /**
237
     * Returns a list of users whose attributes match the query term.
238
     * The returned object includes the `html` field where the matched query term is highlighted with the HTML strong tag.
239
     * A list of account IDs can be provided to exclude users from the results
240
     * 
241
     * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns only the users from that range that match the query term.
242
     * This means the operation usually returns fewer users than specified in `maxResults`.
243
     * To get all the users who match the query term, use "Get all users" and filter the records in your code
244
     * 
245
     * Privacy controls are applied to the response based on the users' preferences.
246
     * This could mean, for example, that the user's email address is hidden.
247
     * See the "Profile visibility overview" for more details
248
     * 
249
     * This operation can be accessed anonymously
250
     * 
251
     * **"Permissions" required:** *Browse users and groups* "global permission".
252
     * Anonymous calls and calls by users without the required permission return search results for an exact name match only.
253
     * 
254
     * @link https://developer.atlassian.com/cloud/jira/platform/profile-visibility/
255
     * @link https://confluence.atlassian.com/x/x4dKLg
256
     * 
257
     * @param string $query A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant users.
258
     *                      The string can match the prefix of the attribute's value.
259
     *                      For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*.
260
     * @param int $maxResults The maximum number of items to return.
261
     *                        The total number of matched users is returned in `total`.
262
     * @param bool $showAvatar Include the URI to the user's avatar.
263
     * @param ?list<string> $exclude This parameter is no longer available.
264
     *                               See the "deprecation notice" for details.
265
     *                               @link https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide
266
     * @param ?list<string> $excludeAccountIds A list of account IDs to exclude from the search results.
267
     *                                         This parameter accepts a comma-separated list.
268
     *                                         Multiple account IDs can also be provided using an ampersand-separated list.
269
     *                                         For example, `excludeAccountIds=5b10a2844c20165700ede21g,5b10a0effa615349cb016cd8&excludeAccountIds=5b10ac8d82e05b22cc7d4ef5`.
270
     *                                         Cannot be provided with `exclude`.
271
     * @param string $avatarSize 
272
     * @param bool $excludeConnectUsers 
273
     */
274
    public function findUsersForPicker(
×
275
        string $query,
276
        ?int $maxResults = 50,
277
        ?bool $showAvatar = false,
278
        ?array $exclude = null,
279
        ?array $excludeAccountIds = null,
280
        ?string $avatarSize = null,
281
        ?bool $excludeConnectUsers = false,
282
    ): Schema\FoundUsers {
283
        return $this->call(
×
284
            uri: '/rest/api/3/user/picker',
×
285
            method: 'get',
×
286
            query: compact('query', 'maxResults', 'showAvatar', 'exclude', 'excludeAccountIds', 'avatarSize', 'excludeConnectUsers'),
×
287
            success: 200,
×
288
            schema: Schema\FoundUsers::class,
×
289
        );
×
290
    }
291

292
    /**
293
     * Returns a list of active users that match the search string and property
294
     * 
295
     * This operation first applies a filter to match the search string and property, and then takes the filtered users in the range defined by `startAt` and `maxResults`, up to the thousandth user.
296
     * To get all the users who match the search string and property, use "Get all users" and filter the records in your code
297
     * 
298
     * This operation can be accessed anonymously
299
     * 
300
     * Privacy controls are applied to the response based on the users' preferences.
301
     * This could mean, for example, that the user's email address is hidden.
302
     * See the "Profile visibility overview" for more details
303
     * 
304
     * **"Permissions" required:** *Browse users and groups* "global permission".
305
     * Anonymous calls or calls by users without the required permission return empty search results.
306
     * 
307
     * @link https://developer.atlassian.com/cloud/jira/platform/profile-visibility/
308
     * @link https://confluence.atlassian.com/x/x4dKLg
309
     * 
310
     * @param string $query A query string that is matched against user attributes ( `displayName`, and `emailAddress`) to find relevant users.
311
     *                      The string can match the prefix of the attribute's value.
312
     *                      For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*.
313
     *                      Required, unless `accountId` or `property` is specified.
314
     * @param string $username 
315
     * @param string $accountId A query string that is matched exactly against a user `accountId`.
316
     *                          Required, unless `query` or `property` is specified.
317
     * @param int $startAt The index of the first item to return in a page of filtered results (page offset).
318
     * @param int $maxResults The maximum number of items to return per page.
319
     * @param string $property A query string used to search properties.
320
     *                         Property keys are specified by path, so property keys containing dot (.) or equals (=) characters cannot be used.
321
     *                         The query string cannot be specified using a JSON object.
322
     *                         Example: To search for the value of `nested` from `{"something":{"nested":1,"other":2}}` use `thepropertykey.something.nested=1`.
323
     *                         Required, unless `accountId` or `query` is specified.
324
     * 
325
     * @return list<Schema\User>
326
     */
327
    public function findUsers(
×
328
        ?string $query = null,
329
        ?string $username = null,
330
        ?string $accountId = null,
331
        ?int $startAt = 0,
332
        ?int $maxResults = 50,
333
        ?string $property = null,
334
    ): array {
335
        return $this->call(
×
336
            uri: '/rest/api/3/user/search',
×
337
            method: 'get',
×
338
            query: compact('query', 'username', 'accountId', 'startAt', 'maxResults', 'property'),
×
339
            success: 200,
×
340
            schema: [Schema\User::class],
×
341
        );
×
342
    }
343

344
    /**
345
     * Finds users with a structured query and returns a "paginated" list of user details
346
     * 
347
     * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and then returns only the users from that range that match the structured query.
348
     * This means the operation usually returns fewer users than specified in `maxResults`.
349
     * To get all the users who match the structured query, use "Get all users" and filter the records in your code
350
     * 
351
     * **"Permissions" required:** *Browse users and groups* "global permission"
352
     * 
353
     * The query statements are:
354
     * 
355
     *  - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project *PROJ*
356
     *  - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues *PROJ-1* or *PROJ-2*
357
     *  - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues *PROJ-1* or *PROJ-2*
358
     *  - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues *PROJ-1* or *PROJ-2*
359
     *  - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues *PROJ-1* or *PROJ-2*
360
     *  - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues *PROJ-1* or *PROJ-2*
361
     *  - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues *PROJ-1* or *PROJ-2*
362
     *  - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value.
363
     * For example, if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible to use `[location].office.city is "Sydney"` to match the user
364
     * 
365
     * The list of issues can be extended as needed, as in *(PROJ-1, PROJ-2, ...
366
     * PROJ-n)*.
367
     * Statements can be combined using the `AND` and `OR` operators to form more complex queries.
368
     * For example:
369
     * 
370
     * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"`
371
     * 
372
     * @link https://confluence.atlassian.com/x/x4dKLg
373
     * 
374
     * @param string $query The search query.
375
     * @param int $startAt The index of the first item to return in a page of results (page offset).
376
     * @param int $maxResults The maximum number of items to return per page.
377
     */
378
    public function findUsersByQuery(
×
379
        string $query,
380
        ?int $startAt = 0,
381
        ?int $maxResults = 100,
382
    ): Schema\PageBeanUser {
383
        return $this->call(
×
384
            uri: '/rest/api/3/user/search/query',
×
385
            method: 'get',
×
386
            query: compact('query', 'startAt', 'maxResults'),
×
387
            success: 200,
×
388
            schema: Schema\PageBeanUser::class,
×
389
        );
×
390
    }
391

392
    /**
393
     * Finds users with a structured query and returns a "paginated" list of user keys
394
     * 
395
     * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and then returns only the users from that range that match the structured query.
396
     * This means the operation usually returns fewer users than specified in `maxResults`.
397
     * To get all the users who match the structured query, use "Get all users" and filter the records in your code
398
     * 
399
     * **"Permissions" required:** *Browse users and groups* "global permission"
400
     * 
401
     * The query statements are:
402
     * 
403
     *  - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project *PROJ*
404
     *  - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues *PROJ-1* or *PROJ-2*
405
     *  - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues *PROJ-1* or *PROJ-2*
406
     *  - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues *PROJ-1* or *PROJ-2*
407
     *  - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues *PROJ-1* or *PROJ-2*
408
     *  - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues *PROJ-1* or *PROJ-2*
409
     *  - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues *PROJ-1* or *PROJ-2*
410
     *  - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value.
411
     * For example, if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible to use `[location].office.city is "Sydney"` to match the user
412
     * 
413
     * The list of issues can be extended as needed, as in *(PROJ-1, PROJ-2, ...
414
     * PROJ-n)*.
415
     * Statements can be combined using the `AND` and `OR` operators to form more complex queries.
416
     * For example:
417
     * 
418
     * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"`
419
     * 
420
     * @link https://confluence.atlassian.com/x/x4dKLg
421
     * 
422
     * @param string $query The search query.
423
     * @param int $startAt The index of the first item to return in a page of results (page offset).
424
     * @param int $maxResult The maximum number of items to return per page.
425
     */
426
    public function findUserKeysByQuery(
×
427
        string $query,
428
        ?int $startAt = 0,
429
        ?int $maxResult = 100,
430
    ): Schema\PageBeanUserKey {
431
        return $this->call(
×
432
            uri: '/rest/api/3/user/search/query/key',
×
433
            method: 'get',
×
434
            query: compact('query', 'startAt', 'maxResult'),
×
435
            success: 200,
×
436
            schema: Schema\PageBeanUserKey::class,
×
437
        );
×
438
    }
439

440
    /**
441
     * Returns a list of users who fulfill these criteria:
442
     * 
443
     *  - their user attributes match a search string
444
     *  - they have permission to browse issues
445
     * 
446
     * Use this resource to find users who can browse:
447
     * 
448
     *  - an issue, by providing the `issueKey`
449
     *  - any issue in a project, by providing the `projectKey`
450
     * 
451
     * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and then returns only the users from that range that match the search string and have permission to browse issues.
452
     * This means the operation usually returns fewer users than specified in `maxResults`.
453
     * To get all the users who match the search string and have permission to browse issues, use "Get all users" and filter the records in your code
454
     * 
455
     * Privacy controls are applied to the response based on the users' preferences.
456
     * This could mean, for example, that the user's email address is hidden.
457
     * See the "Profile visibility overview" for more details
458
     * 
459
     * This operation can be accessed anonymously
460
     * 
461
     * **"Permissions" required:** *Browse users and groups* "global permission".
462
     * Anonymous calls and calls by users without the required permission return empty search results.
463
     * 
464
     * @link https://developer.atlassian.com/cloud/jira/platform/profile-visibility/
465
     * @link https://confluence.atlassian.com/x/x4dKLg
466
     * 
467
     * @param string $query A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users.
468
     *                      The string can match the prefix of the attribute's value.
469
     *                      For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*.
470
     *                      Required, unless `accountId` is specified.
471
     * @param string $username This parameter is no longer available.
472
     *                         See the "deprecation notice" for details.
473
     *                         @link https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide
474
     * @param string $accountId A query string that is matched exactly against user `accountId`.
475
     *                          Required, unless `query` is specified.
476
     * @param string $issueKey The issue key for the issue.
477
     *                         Required, unless `projectKey` is specified.
478
     * @param string $projectKey The project key for the project (case sensitive).
479
     *                           Required, unless `issueKey` is specified.
480
     * @param int $startAt The index of the first item to return in a page of results (page offset).
481
     * @param int $maxResults The maximum number of items to return per page.
482
     * 
483
     * @return list<Schema\User>
484
     */
485
    public function findUsersWithBrowsePermission(
×
486
        ?string $query = null,
487
        ?string $username = null,
488
        ?string $accountId = null,
489
        ?string $issueKey = null,
490
        ?string $projectKey = null,
491
        ?int $startAt = 0,
492
        ?int $maxResults = 50,
493
    ): array {
494
        return $this->call(
×
495
            uri: '/rest/api/3/user/viewissue/search',
×
496
            method: 'get',
×
497
            query: compact('query', 'username', 'accountId', 'issueKey', 'projectKey', 'startAt', 'maxResults'),
×
498
            success: 200,
×
499
            schema: [Schema\User::class],
×
500
        );
×
501
    }
502
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc