• 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/ProjectRoleActors.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 ProjectRoleActors
10
{
11
    /**
12
     * Sets the actors for a project role for a project, replacing all existing actors
13
     * 
14
     * To add actors to the project without overwriting the existing list, use "Add actors to project role"
15
     * 
16
     * **"Permissions" required:** *Administer Projects* "project permission" for the project or *Administer Jira* "global permission".
17
     * 
18
     * @link https://confluence.atlassian.com/x/yodKLg
19
     * @link https://confluence.atlassian.com/x/x4dKLg
20
     * 
21
     * @param string $projectIdOrKey The project ID or project key (case sensitive).
22
     * @param int $id The ID of the project role.
23
     *                Use "Get all project roles" to get a list of project role IDs.
24
     */
25
    public function setActors(
×
26
        Schema\ProjectRoleActorsUpdateBean $request,
27
        string $projectIdOrKey,
28
        int $id,
29
    ): Schema\ProjectRole {
30
        return $this->call(
×
31
            uri: '/rest/api/3/project/{projectIdOrKey}/role/{id}',
×
32
            method: 'put',
×
33
            body: $request,
×
34
            path: compact('projectIdOrKey', 'id'),
×
35
            success: 200,
×
36
            schema: Schema\ProjectRole::class,
×
37
        );
×
38
    }
39

40
    /**
41
     * Adds actors to a project role for the project
42
     * 
43
     * To replace all actors for the project, use "Set actors for project role"
44
     * 
45
     * This operation can be accessed anonymously
46
     * 
47
     * **"Permissions" required:** *Administer Projects* "project permission" for the project or *Administer Jira* "global permission".
48
     * 
49
     * @link https://confluence.atlassian.com/x/yodKLg
50
     * @link https://confluence.atlassian.com/x/x4dKLg
51
     * 
52
     * @param string $projectIdOrKey The project ID or project key (case sensitive).
53
     * @param int $id The ID of the project role.
54
     *                Use "Get all project roles" to get a list of project role IDs.
55
     */
56
    public function addActorUsers(
×
57
        Schema\ActorsMap $request,
58
        string $projectIdOrKey,
59
        int $id,
60
    ): Schema\ProjectRole {
61
        return $this->call(
×
62
            uri: '/rest/api/3/project/{projectIdOrKey}/role/{id}',
×
63
            method: 'post',
×
64
            body: $request,
×
65
            path: compact('projectIdOrKey', 'id'),
×
66
            success: 200,
×
67
            schema: Schema\ProjectRole::class,
×
68
        );
×
69
    }
70

71
    /**
72
     * Deletes actors from a project role for the project
73
     * 
74
     * To remove default actors from the project role, use "Delete default actors from project role"
75
     * 
76
     * This operation can be accessed anonymously
77
     * 
78
     * **"Permissions" required:** *Administer Projects* "project permission" for the project or *Administer Jira* "global permission".
79
     * 
80
     * @link https://confluence.atlassian.com/x/yodKLg
81
     * @link https://confluence.atlassian.com/x/x4dKLg
82
     * 
83
     * @param string $projectIdOrKey The project ID or project key (case sensitive).
84
     * @param int $id The ID of the project role.
85
     *                Use "Get all project roles" to get a list of project role IDs.
86
     * @param string $user The user account ID of the user to remove from the project role.
87
     * @param string $group The name of the group to remove from the project role.
88
     *                      This parameter cannot be used with the `groupId` parameter.
89
     *                      As a group's name can change, use of `groupId` is recommended.
90
     * @param string $groupId The ID of the group to remove from the project role.
91
     *                        This parameter cannot be used with the `group` parameter.
92
     */
93
    public function deleteActor(
×
94
        string $projectIdOrKey,
95
        int $id,
96
        ?string $user = null,
97
        ?string $group = null,
98
        ?string $groupId = null,
99
    ): true {
100
        return $this->call(
×
101
            uri: '/rest/api/3/project/{projectIdOrKey}/role/{id}',
×
102
            method: 'delete',
×
103
            query: compact('user', 'group', 'groupId'),
×
104
            path: compact('projectIdOrKey', 'id'),
×
105
            success: 204,
×
106
            schema: true,
×
107
        );
×
108
    }
109

110
    /**
111
     * Returns the "default actors" for the project role
112
     * 
113
     * **"Permissions" required:** *Administer Jira* "global permission".
114
     * 
115
     * @link https://confluence.atlassian.com/x/x4dKLg
116
     * 
117
     * @param int $id The ID of the project role.
118
     *                Use "Get all project roles" to get a list of project role IDs.
119
     */
120
    public function getProjectRoleActorsForRole(
×
121
        int $id,
122
    ): Schema\ProjectRole {
123
        return $this->call(
×
124
            uri: '/rest/api/3/role/{id}/actors',
×
125
            method: 'get',
×
126
            path: compact('id'),
×
127
            success: 200,
×
128
            schema: Schema\ProjectRole::class,
×
129
        );
×
130
    }
131

132
    /**
133
     * Adds "default actors" to a role.
134
     * You may add groups or users, but you cannot add groups and users in the same request
135
     * 
136
     * Changing a project role's default actors does not affect project role members for projects already created
137
     * 
138
     * **"Permissions" required:** *Administer Jira* "global permission".
139
     * 
140
     * @link https://confluence.atlassian.com/x/x4dKLg
141
     * 
142
     * @param int $id The ID of the project role.
143
     *                Use "Get all project roles" to get a list of project role IDs.
144
     */
145
    public function addProjectRoleActorsToRole(
×
146
        Schema\ActorInputBean $request,
147
        int $id,
148
    ): Schema\ProjectRole {
149
        return $this->call(
×
150
            uri: '/rest/api/3/role/{id}/actors',
×
151
            method: 'post',
×
152
            body: $request,
×
153
            path: compact('id'),
×
154
            success: 200,
×
155
            schema: Schema\ProjectRole::class,
×
156
        );
×
157
    }
158

159
    /**
160
     * Deletes the "default actors" from a project role.
161
     * You may delete a group or user, but you cannot delete a group and a user in the same request
162
     * 
163
     * Changing a project role's default actors does not affect project role members for projects already created
164
     * 
165
     * **"Permissions" required:** *Administer Jira* "global permission".
166
     * 
167
     * @link https://confluence.atlassian.com/x/x4dKLg
168
     * 
169
     * @param int $id The ID of the project role.
170
     *                Use "Get all project roles" to get a list of project role IDs.
171
     * @param string $user The user account ID of the user to remove as a default actor.
172
     * @param string $groupId The group ID of the group to be removed as a default actor.
173
     *                        This parameter cannot be used with the `group` parameter.
174
     * @param string $group The group name of the group to be removed as a default actor.This parameter cannot be used with the `groupId` parameter.
175
     *                      As a group's name can change, use of `groupId` is recommended.
176
     */
177
    public function deleteProjectRoleActorsFromRole(
×
178
        int $id,
179
        ?string $user = null,
180
        ?string $groupId = null,
181
        ?string $group = null,
182
    ): Schema\ProjectRole {
183
        return $this->call(
×
184
            uri: '/rest/api/3/role/{id}/actors',
×
185
            method: 'delete',
×
186
            query: compact('user', 'groupId', 'group'),
×
187
            path: compact('id'),
×
188
            success: 200,
×
189
            schema: Schema\ProjectRole::class,
×
190
        );
×
191
    }
192
}
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