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

tylernathanreed / jira-client-php / 13857440588

14 Mar 2025 01:18PM UTC coverage: 70.825% (-0.06%) from 70.885%
13857440588

push

github

tylernathanreed
~ Fixed nested objects in test examples

9 of 9 new or added lines in 1 file covered. (100.0%)

524 existing lines in 407 files now uncovered.

4826 of 6814 relevant lines covered (70.82%)

8.59 hits per line

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

88.0
/src/Operations/TeamsInPlan.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 TeamsInPlan
10
{
11
    /**
12
     * Returns a "paginated" list of plan-only and Atlassian teams in a plan
13
     * 
14
     * **"Permissions" required:** *Administer Jira* "global permission".
15
     * 
16
     * @link https://confluence.atlassian.com/x/x4dKLg
17
     * 
18
     * @param int $planId The ID of the plan.
19
     * @param string $cursor The cursor to start from.
20
     *                       If not provided, the first page will be returned.
21
     * @param int $maxResults The maximum number of plan teams to return per page.
22
     *                        The maximum value is 50.
23
     *                        The default value is 50.
24
     */
25
    public function getTeams(
1✔
26
        int $planId,
27
        ?string $cursor = '',
28
        ?int $maxResults = 50,
29
    ): Schema\PageWithCursorGetTeamResponseForPage {
30
        return $this->call(
1✔
31
            uri: '/rest/api/3/plans/plan/{planId}/team',
1✔
32
            method: 'get',
1✔
33
            query: compact('cursor', 'maxResults'),
1✔
34
            path: compact('planId'),
1✔
35
            success: 200,
1✔
36
            schema: Schema\PageWithCursorGetTeamResponseForPage::class,
1✔
37
        );
1✔
38
    }
39

40
    /**
41
     * Adds an existing Atlassian team to a plan and configures their plannning settings
42
     * 
43
     * **"Permissions" required:** *Administer Jira* "global permission".
44
     * 
45
     * @link https://confluence.atlassian.com/x/x4dKLg
46
     * 
47
     * @param int $planId The ID of the plan.
48
     */
49
    public function addAtlassianTeam(
1✔
50
        Schema\AddAtlassianTeamRequest $request,
51
        int $planId,
52
    ): true {
53
        return $this->call(
1✔
54
            uri: '/rest/api/3/plans/plan/{planId}/team/atlassian',
1✔
55
            method: 'post',
1✔
56
            body: $request,
1✔
57
            path: compact('planId'),
1✔
58
            success: 204,
1✔
59
            schema: true,
1✔
60
        );
1✔
61
    }
62

63
    /**
64
     * Returns planning settings for an Atlassian team in a plan
65
     * 
66
     * **"Permissions" required:** *Administer Jira* "global permission".
67
     * 
68
     * @link https://confluence.atlassian.com/x/x4dKLg
69
     * 
70
     * @param int $planId The ID of the plan.
71
     * @param string $atlassianTeamId The ID of the Atlassian team.
72
     */
73
    public function getAtlassianTeam(
1✔
74
        int $planId,
75
        string $atlassianTeamId,
76
    ): Schema\GetAtlassianTeamResponse {
77
        return $this->call(
1✔
78
            uri: '/rest/api/3/plans/plan/{planId}/team/atlassian/{atlassianTeamId}',
1✔
79
            method: 'get',
1✔
80
            path: compact('planId', 'atlassianTeamId'),
1✔
81
            success: 200,
1✔
82
            schema: Schema\GetAtlassianTeamResponse::class,
1✔
83
        );
1✔
84
    }
85

86
    /**
87
     * Updates any of the following planning settings of an Atlassian team in a plan using "JSON Patch"
88
     * 
89
     *  - planningStyle
90
     *  - issueSourceId
91
     *  - sprintLength
92
     *  - capacity
93
     * 
94
     * **"Permissions" required:** *Administer Jira* "global permission"
95
     * 
96
     * *Note that "add" operations do not respect array indexes in target locations.
97
     * Call the "Get Atlassian team in plan" endpoint to find out the order of array elements.*
98
     * 
99
     * @link https://datatracker.ietf.org/doc/html/rfc6902
100
     * @link https://confluence.atlassian.com/x/x4dKLg
101
     * 
102
     * @param int $planId The ID of the plan.
103
     * @param string $atlassianTeamId The ID of the Atlassian team.
104
     */
105
    public function updateAtlassianTeam(
1✔
106
        int $planId,
107
        string $atlassianTeamId,
108
    ): true {
109
        return $this->call(
1✔
110
            uri: '/rest/api/3/plans/plan/{planId}/team/atlassian/{atlassianTeamId}',
1✔
111
            method: 'put',
1✔
112
            path: compact('planId', 'atlassianTeamId'),
1✔
113
            success: 204,
1✔
114
            schema: true,
1✔
115
        );
1✔
116
    }
117

118
    /**
119
     * Removes an Atlassian team from a plan and deletes their planning settings
120
     * 
121
     * **"Permissions" required:** *Administer Jira* "global permission".
122
     * 
123
     * @link https://confluence.atlassian.com/x/x4dKLg
124
     * 
125
     * @param int $planId The ID of the plan.
126
     * @param string $atlassianTeamId The ID of the Atlassian team.
127
     */
128
    public function removeAtlassianTeam(
1✔
129
        int $planId,
130
        string $atlassianTeamId,
131
    ): true {
132
        return $this->call(
1✔
133
            uri: '/rest/api/3/plans/plan/{planId}/team/atlassian/{atlassianTeamId}',
1✔
134
            method: 'delete',
1✔
135
            path: compact('planId', 'atlassianTeamId'),
1✔
136
            success: 204,
1✔
137
            schema: true,
1✔
138
        );
1✔
139
    }
140

141
    /**
142
     * Creates a plan-only team and configures their planning settings
143
     * 
144
     * **"Permissions" required:** *Administer Jira* "global permission".
145
     * 
146
     * @link https://confluence.atlassian.com/x/x4dKLg
147
     * 
148
     * @param int $planId The ID of the plan.
149
     */
UNCOV
150
    public function createPlanOnlyTeam(
×
151
        Schema\CreatePlanOnlyTeamRequest $request,
152
        int $planId,
153
    ): true {
154
        return $this->call(
×
155
            uri: '/rest/api/3/plans/plan/{planId}/team/planonly',
×
156
            method: 'post',
×
157
            body: $request,
×
158
            path: compact('planId'),
×
159
            success: 201,
×
160
            schema: true,
×
161
        );
×
162
    }
163

164
    /**
165
     * Returns planning settings for a plan-only team
166
     * 
167
     * **"Permissions" required:** *Administer Jira* "global permission".
168
     * 
169
     * @link https://confluence.atlassian.com/x/x4dKLg
170
     * 
171
     * @param int $planId The ID of the plan.
172
     * @param int $planOnlyTeamId The ID of the plan-only team.
173
     */
174
    public function getPlanOnlyTeam(
1✔
175
        int $planId,
176
        int $planOnlyTeamId,
177
    ): Schema\GetPlanOnlyTeamResponse {
178
        return $this->call(
1✔
179
            uri: '/rest/api/3/plans/plan/{planId}/team/planonly/{planOnlyTeamId}',
1✔
180
            method: 'get',
1✔
181
            path: compact('planId', 'planOnlyTeamId'),
1✔
182
            success: 200,
1✔
183
            schema: Schema\GetPlanOnlyTeamResponse::class,
1✔
184
        );
1✔
185
    }
186

187
    /**
188
     * Updates any of the following planning settings of a plan-only team using "JSON Patch"
189
     * 
190
     *  - name
191
     *  - planningStyle
192
     *  - issueSourceId
193
     *  - sprintLength
194
     *  - capacity
195
     *  - memberAccountIds
196
     * 
197
     * **"Permissions" required:** *Administer Jira* "global permission"
198
     * 
199
     * *Note that "add" operations do not respect array indexes in target locations.
200
     * Call the "Get plan-only team" endpoint to find out the order of array elements.*
201
     * 
202
     * @link https://datatracker.ietf.org/doc/html/rfc6902
203
     * @link https://confluence.atlassian.com/x/x4dKLg
204
     * 
205
     * @param int $planId The ID of the plan.
206
     * @param int $planOnlyTeamId The ID of the plan-only team.
207
     */
208
    public function updatePlanOnlyTeam(
1✔
209
        int $planId,
210
        int $planOnlyTeamId,
211
    ): true {
212
        return $this->call(
1✔
213
            uri: '/rest/api/3/plans/plan/{planId}/team/planonly/{planOnlyTeamId}',
1✔
214
            method: 'put',
1✔
215
            path: compact('planId', 'planOnlyTeamId'),
1✔
216
            success: 204,
1✔
217
            schema: true,
1✔
218
        );
1✔
219
    }
220

221
    /**
222
     * Deletes a plan-only team and their planning settings
223
     * 
224
     * **"Permissions" required:** *Administer Jira* "global permission".
225
     * 
226
     * @link https://confluence.atlassian.com/x/x4dKLg
227
     * 
228
     * @param int $planId The ID of the plan.
229
     * @param int $planOnlyTeamId The ID of the plan-only team.
230
     */
231
    public function deletePlanOnlyTeam(
1✔
232
        int $planId,
233
        int $planOnlyTeamId,
234
    ): true {
235
        return $this->call(
1✔
236
            uri: '/rest/api/3/plans/plan/{planId}/team/planonly/{planOnlyTeamId}',
1✔
237
            method: 'delete',
1✔
238
            path: compact('planId', 'planOnlyTeamId'),
1✔
239
            success: 204,
1✔
240
            schema: true,
1✔
241
        );
1✔
242
    }
243
}
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