• 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/UserProperties.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 UserProperties
10
{
11
    /**
12
     * Returns the keys of all properties for a user
13
     * 
14
     * Note: This operation does not access the "user properties" created and maintained in Jira
15
     * 
16
     * **"Permissions" required:**
17
     * 
18
     *  - *Administer Jira* "global permission", to access the property keys on any user
19
     *  - Access to Jira, to access the calling user's property keys.
20
     * 
21
     * @link https://confluence.atlassian.com/x/8YxjL
22
     * @link https://confluence.atlassian.com/x/x4dKLg
23
     * 
24
     * @param string $accountId The account ID of the user, which uniquely identifies the user across all Atlassian products.
25
     *                          For example, *5b10ac8d82e05b22cc7d4ef5*.
26
     * @param string $userKey This parameter is no longer available and will be removed from the documentation soon.
27
     *                        See the "deprecation notice" for details.
28
     *                        @link https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide
29
     * @param string $username This parameter is no longer available and will be removed from the documentation soon.
30
     *                         See the "deprecation notice" for details.
31
     *                         @link https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide
32
     */
33
    public function getUserPropertyKeys(
×
34
        ?string $accountId = null,
35
        ?string $userKey = null,
36
        ?string $username = null,
37
    ): Schema\PropertyKeys {
38
        return $this->call(
×
39
            uri: '/rest/api/3/user/properties',
×
40
            method: 'get',
×
41
            query: compact('accountId', 'userKey', 'username'),
×
42
            success: 200,
×
43
            schema: Schema\PropertyKeys::class,
×
44
        );
×
45
    }
46

47
    /**
48
     * Returns the value of a user's property.
49
     * If no property key is provided "Get user property keys" is called
50
     * 
51
     * Note: This operation does not access the "user properties" created and maintained in Jira
52
     * 
53
     * **"Permissions" required:**
54
     * 
55
     *  - *Administer Jira* "global permission", to get a property from any user
56
     *  - Access to Jira, to get a property from the calling user's record.
57
     * 
58
     * @link https://confluence.atlassian.com/x/8YxjL
59
     * @link https://confluence.atlassian.com/x/x4dKLg
60
     * 
61
     * @param string $propertyKey The key of the user's property.
62
     * @param string $accountId The account ID of the user, which uniquely identifies the user across all Atlassian products.
63
     *                          For example, *5b10ac8d82e05b22cc7d4ef5*.
64
     * @param string $userKey This parameter is no longer available and will be removed from the documentation soon.
65
     *                        See the "deprecation notice" for details.
66
     *                        @link https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide
67
     * @param string $username This parameter is no longer available and will be removed from the documentation soon.
68
     *                         See the "deprecation notice" for details.
69
     *                         @link https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide
70
     */
71
    public function getUserProperty(
×
72
        string $propertyKey,
73
        ?string $accountId = null,
74
        ?string $userKey = null,
75
        ?string $username = null,
76
    ): Schema\EntityProperty {
77
        return $this->call(
×
78
            uri: '/rest/api/3/user/properties/{propertyKey}',
×
79
            method: 'get',
×
80
            query: compact('accountId', 'userKey', 'username'),
×
81
            path: compact('propertyKey'),
×
82
            success: 200,
×
83
            schema: Schema\EntityProperty::class,
×
84
        );
×
85
    }
86

87
    /**
88
     * Sets the value of a user's property.
89
     * Use this resource to store custom data against a user
90
     * 
91
     * Note: This operation does not access the "user properties" created and maintained in Jira
92
     * 
93
     * **"Permissions" required:**
94
     * 
95
     *  - *Administer Jira* "global permission", to set a property on any user
96
     *  - Access to Jira, to set a property on the calling user's record.
97
     * 
98
     * @link https://confluence.atlassian.com/x/8YxjL
99
     * @link https://confluence.atlassian.com/x/x4dKLg
100
     * 
101
     * @param string $propertyKey The key of the user's property.
102
     *                            The maximum length is 255 characters.
103
     * @param string $accountId The account ID of the user, which uniquely identifies the user across all Atlassian products.
104
     *                          For example, *5b10ac8d82e05b22cc7d4ef5*.
105
     * @param string $userKey This parameter is no longer available and will be removed from the documentation soon.
106
     *                        See the "deprecation notice" for details.
107
     *                        @link https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide
108
     * @param string $username This parameter is no longer available and will be removed from the documentation soon.
109
     *                         See the "deprecation notice" for details.
110
     *                         @link https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide
111
     */
112
    public function setUserProperty(
×
113
        string $propertyKey,
114
        ?string $accountId = null,
115
        ?string $userKey = null,
116
        ?string $username = null,
117
    ): true {
118
        return $this->call(
×
119
            uri: '/rest/api/3/user/properties/{propertyKey}',
×
120
            method: 'put',
×
121
            query: compact('accountId', 'userKey', 'username'),
×
122
            path: compact('propertyKey'),
×
123
            success: 200,
×
124
            schema: true,
×
125
        );
×
126
    }
127

128
    /**
129
     * Deletes a property from a user
130
     * 
131
     * Note: This operation does not access the "user properties" created and maintained in Jira
132
     * 
133
     * **"Permissions" required:**
134
     * 
135
     *  - *Administer Jira* "global permission", to delete a property from any user
136
     *  - Access to Jira, to delete a property from the calling user's record.
137
     * 
138
     * @link https://confluence.atlassian.com/x/8YxjL
139
     * @link https://confluence.atlassian.com/x/x4dKLg
140
     * 
141
     * @param string $propertyKey The key of the user's property.
142
     * @param string $accountId The account ID of the user, which uniquely identifies the user across all Atlassian products.
143
     *                          For example, *5b10ac8d82e05b22cc7d4ef5*.
144
     * @param string $userKey This parameter is no longer available and will be removed from the documentation soon.
145
     *                        See the "deprecation notice" for details.
146
     *                        @link https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide
147
     * @param string $username This parameter is no longer available and will be removed from the documentation soon.
148
     *                         See the "deprecation notice" for details.
149
     *                         @link https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide
150
     */
151
    public function deleteUserProperty(
×
152
        string $propertyKey,
153
        ?string $accountId = null,
154
        ?string $userKey = null,
155
        ?string $username = null,
156
    ): true {
157
        return $this->call(
×
158
            uri: '/rest/api/3/user/properties/{propertyKey}',
×
159
            method: 'delete',
×
160
            query: compact('accountId', 'userKey', 'username'),
×
161
            path: compact('propertyKey'),
×
162
            success: 204,
×
163
            schema: true,
×
164
        );
×
165
    }
166
}
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