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

tylernathanreed / jira-client-php / 13634794100

03 Mar 2025 03:19PM UTC coverage: 2.067% (-0.1%) from 2.21%
13634794100

push

github

web-flow
~ Try coveralls action

140 of 6773 relevant lines covered (2.07%)

0.03 hits per line

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

0.0
/src/Operations/GroupAndUserPicker.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 GroupAndUserPicker
10
{
11
    /**
12
     * Returns a list of users and groups matching a string.
13
     * The string is used:
14
     * 
15
     *  - for users, to find a case-insensitive match with display name and e-mail address.
16
     * Note that if a user has hidden their email address in their user profile, partial matches of the email address will not find the user.
17
     * An exact match is required
18
     *  - for groups, to find a case-sensitive match with group name
19
     * 
20
     * For example, if the string *tin* is used, records with the display name *Tina*, email address *sarah@tinplatetraining.com*, and the group *accounting* would be returned
21
     * 
22
     * Optionally, the search can be refined to:
23
     * 
24
     *  - the projects and issue types associated with a custom field, such as a user picker.
25
     * The search can then be further refined to return only users and groups that have permission to view specific:
26
     *     
27
     *      - projects
28
     *      - issue types
29
     *     
30
     *     If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or no results are returned.
31
     * For example, if a field is enabled for projects A, B, and C then the search could be limited to projects B and C.
32
     * However, if the search is limited to projects B and D, nothing is returned
33
     *  - not return Connect app users and groups
34
     *  - return groups that have a case-insensitive match with the query
35
     * 
36
     * The primary use case for this resource is to populate a picker field suggestion list with users or groups.
37
     * To this end, the returned object includes an `html` field for each list.
38
     * This field highlights the matched query term in the item name with the HTML strong tag.
39
     * Also, each list is wrapped in a response object that contains a header for use in a picker, specifically *Showing X of Y matching groups*
40
     * 
41
     * This operation can be accessed anonymously
42
     * 
43
     * **"Permissions" required:** *Browse users and groups* "global permission".
44
     * 
45
     * @link https://confluence.atlassian.com/x/yodKLg
46
     * 
47
     * @param string $query The search string.
48
     * @param int $maxResults The maximum number of items to return in each list.
49
     * @param bool $showAvatar Whether the user avatar should be returned.
50
     *                         If an invalid value is provided, the default value is used.
51
     * @param string $fieldId The custom field ID of the field this request is for.
52
     * @param ?list<string> $projectId The ID of a project that returned users and groups must have permission to view.
53
     *                                 To include multiple projects, provide an ampersand-separated list.
54
     *                                 For example, `projectId=10000&projectId=10001`.
55
     *                                 This parameter is only used when `fieldId` is present.
56
     * @param ?list<string> $issueTypeId The ID of an issue type that returned users and groups must have permission to view.
57
     *                                   To include multiple issue types, provide an ampersand-separated list.
58
     *                                   For example, `issueTypeId=10000&issueTypeId=10001`.
59
     *                                   Special values, such as `-1` (all standard issue types) and `-2` (all subtask issue types), are supported.
60
     *                                   This parameter is only used when `fieldId` is present.
61
     * @param 'xsmall'|'xsmall@2x'|'xsmall@3x'|'small'|'small@2x'|'small@3x'|'medium'|'medium@2x'|'medium@3x'|'large'|'large@2x'|'large@3x'|'xlarge'|'xlarge@2x'|'xlarge@3x'|'xxlarge'|'xxlarge@2x'|'xxlarge@3x'|'xxxlarge'|'xxxlarge@2x'|'xxxlarge@3x'|null $avatarSize
62
     *        The size of the avatar to return.
63
     *        If an invalid value is provided, the default value is used.
64
     * @param bool $caseInsensitive Whether the search for groups should be case insensitive.
65
     * @param bool $excludeConnectAddons Whether Connect app users and groups should be excluded from the search results.
66
     *                                   If an invalid value is provided, the default value is used.
67
     */
68
    public function findUsersAndGroups(
×
69
        string $query,
70
        ?int $maxResults = 50,
71
        ?bool $showAvatar = false,
72
        ?string $fieldId = null,
73
        ?array $projectId = null,
74
        ?array $issueTypeId = null,
75
        ?string $avatarSize = 'xsmall',
76
        ?bool $caseInsensitive = false,
77
        ?bool $excludeConnectAddons = false,
78
    ): Schema\FoundUsersAndGroups {
79
        return $this->call(
×
80
            uri: '/rest/api/3/groupuserpicker',
×
81
            method: 'get',
×
82
            query: compact('query', 'maxResults', 'showAvatar', 'fieldId', 'projectId', 'issueTypeId', 'avatarSize', 'caseInsensitive', 'excludeConnectAddons'),
×
83
            success: 200,
×
84
            schema: Schema\FoundUsersAndGroups::class,
×
85
        );
×
86
    }
87
}
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