• 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/Status.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 Status
10
{
11
    /**
12
     * Returns a list of the statuses specified by one or more status IDs
13
     * 
14
     * **"Permissions" required:**
15
     * 
16
     *  - *Administer projects* "project permission."
17
     *  - *Administer Jira* "project permission."
18
     * 
19
     * @link https://confluence.atlassian.com/x/yodKLg
20
     * 
21
     * @param list<string> $id The list of status IDs.
22
     *                         To include multiple IDs, provide an ampersand-separated list.
23
     *                         For example, id=10000&id=10001
24
     *                         Min items `1`, Max items `50`
25
     * @param string $expand Deprecated.
26
     *                       See the "deprecation notice" for details
27
     *                       Use "expand" to include additional information in the response.
28
     *                       This parameter accepts a comma-separated list.
29
     *                       Expand options include:
30
     *                        - `usages` Returns the project and issue types that use the status in their workflow
31
     *                        - `workflowUsages` Returns the workflows that use the status.
32
     *                       @link https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298
33
     * 
34
     * @return list<Schema\JiraStatus>
35
     */
36
    public function getStatusesById(
×
37
        array $id,
38
        ?string $expand = null,
39
    ): array {
40
        return $this->call(
×
41
            uri: '/rest/api/3/statuses',
×
42
            method: 'get',
×
43
            query: compact('id', 'expand'),
×
44
            success: 200,
×
45
            schema: [Schema\JiraStatus::class],
×
46
        );
×
47
    }
48

49
    /**
50
     * Updates statuses by ID
51
     * 
52
     * **"Permissions" required:**
53
     * 
54
     *  - *Administer projects* "project permission."
55
     *  - *Administer Jira* "project permission."
56
     * 
57
     * @link https://confluence.atlassian.com/x/yodKLg
58
     */
59
    public function updateStatuses(
×
60
        Schema\StatusUpdateRequest $request,
61
    ): true {
62
        return $this->call(
×
63
            uri: '/rest/api/3/statuses',
×
64
            method: 'put',
×
65
            body: $request,
×
66
            success: 204,
×
67
            schema: true,
×
68
        );
×
69
    }
70

71
    /**
72
     * Creates statuses for a global or project scope
73
     * 
74
     * **"Permissions" required:**
75
     * 
76
     *  - *Administer projects* "project permission."
77
     *  - *Administer Jira* "project permission."
78
     * 
79
     * @link https://confluence.atlassian.com/x/yodKLg
80
     * 
81
     * @return list<Schema\JiraStatus>
82
     */
83
    public function createStatuses(
×
84
        Schema\StatusCreateRequest $request,
85
    ): array {
86
        return $this->call(
×
87
            uri: '/rest/api/3/statuses',
×
88
            method: 'post',
×
89
            body: $request,
×
90
            success: 200,
×
91
            schema: [Schema\JiraStatus::class],
×
92
        );
×
93
    }
94

95
    /**
96
     * Deletes statuses by ID
97
     * 
98
     * **"Permissions" required:**
99
     * 
100
     *  - *Administer projects* "project permission."
101
     *  - *Administer Jira* "project permission."
102
     * 
103
     * @link https://confluence.atlassian.com/x/yodKLg
104
     * 
105
     * @param list<string> $id The list of status IDs.
106
     *                         To include multiple IDs, provide an ampersand-separated list.
107
     *                         For example, id=10000&id=10001
108
     *                         Min items `1`, Max items `50`
109
     */
110
    public function deleteStatusesById(
×
111
        array $id,
112
    ): true {
113
        return $this->call(
×
114
            uri: '/rest/api/3/statuses',
×
115
            method: 'delete',
×
116
            query: compact('id'),
×
117
            success: 204,
×
118
            schema: true,
×
119
        );
×
120
    }
121

122
    /**
123
     * Returns a "paginated" list of statuses that match a search on name or project
124
     * 
125
     * **"Permissions" required:**
126
     * 
127
     *  - *Administer projects* "project permission."
128
     *  - *Administer Jira* "project permission."
129
     * 
130
     * @link https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination
131
     * @link https://confluence.atlassian.com/x/yodKLg
132
     * 
133
     * @param string $expand Deprecated.
134
     *                       See the "deprecation notice" for details
135
     *                       Use "expand" to include additional information in the response.
136
     *                       This parameter accepts a comma-separated list.
137
     *                       Expand options include:
138
     *                        - `usages` Returns the project and issue types that use the status in their workflow
139
     *                        - `workflowUsages` Returns the workflows that use the status.
140
     *                       @link https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298
141
     * @param string $projectId The project the status is part of or null for global statuses.
142
     * @param int $startAt The index of the first item to return in a page of results (page offset).
143
     * @param int $maxResults The maximum number of items to return per page.
144
     * @param string $searchString Term to match status names against or null to search for all statuses in the search scope.
145
     * @param string $statusCategory Category of the status to filter by.
146
     *                               The supported values are: `TODO`, `IN_PROGRESS`, and `DONE`.
147
     */
148
    public function search(
×
149
        ?string $expand = null,
150
        ?string $projectId = null,
151
        ?int $startAt = 0,
152
        ?int $maxResults = 200,
153
        ?string $searchString = null,
154
        ?string $statusCategory = null,
155
    ): Schema\PageOfStatuses {
156
        return $this->call(
×
157
            uri: '/rest/api/3/statuses/search',
×
158
            method: 'get',
×
159
            query: compact('expand', 'projectId', 'startAt', 'maxResults', 'searchString', 'statusCategory'),
×
160
            success: 200,
×
161
            schema: Schema\PageOfStatuses::class,
×
162
        );
×
163
    }
164

165
    /**
166
     * Returns a page of issue types in a project using a given status.
167
     * 
168
     * @param string $statusId The statusId to fetch issue type usages for
169
     * @param string $projectId The projectId to fetch issue type usages for
170
     * @param string $nextPageToken The cursor for pagination
171
     * @param int $maxResults The maximum number of results to return.
172
     *                        Must be an integer between 1 and 200.
173
     */
174
    public function getProjectIssueTypeUsagesForStatus(
×
175
        string $statusId,
176
        string $projectId,
177
        ?string $nextPageToken = null,
178
        ?int $maxResults = 50,
179
    ): Schema\StatusProjectIssueTypeUsageDTO {
180
        return $this->call(
×
181
            uri: '/rest/api/3/statuses/{statusId}/project/{projectId}/issueTypeUsages',
×
182
            method: 'get',
×
183
            query: compact('nextPageToken', 'maxResults'),
×
184
            path: compact('statusId', 'projectId'),
×
185
            success: 200,
×
186
            schema: Schema\StatusProjectIssueTypeUsageDTO::class,
×
187
        );
×
188
    }
189

190
    /**
191
     * Returns a page of projects using a given status.
192
     * 
193
     * @param string $statusId The statusId to fetch project usages for
194
     * @param string $nextPageToken The cursor for pagination
195
     * @param int $maxResults The maximum number of results to return.
196
     *                        Must be an integer between 1 and 200.
197
     */
198
    public function getProjectUsagesForStatus(
×
199
        string $statusId,
200
        ?string $nextPageToken = null,
201
        ?int $maxResults = 50,
202
    ): Schema\StatusProjectUsageDTO {
203
        return $this->call(
×
204
            uri: '/rest/api/3/statuses/{statusId}/projectUsages',
×
205
            method: 'get',
×
206
            query: compact('nextPageToken', 'maxResults'),
×
207
            path: compact('statusId'),
×
208
            success: 200,
×
209
            schema: Schema\StatusProjectUsageDTO::class,
×
210
        );
×
211
    }
212

213
    /**
214
     * Returns a page of workflows using a given status.
215
     * 
216
     * @param string $statusId The statusId to fetch workflow usages for
217
     * @param string $nextPageToken The cursor for pagination
218
     * @param int $maxResults The maximum number of results to return.
219
     *                        Must be an integer between 1 and 200.
220
     */
221
    public function getWorkflowUsagesForStatus(
×
222
        string $statusId,
223
        ?string $nextPageToken = null,
224
        ?int $maxResults = 50,
225
    ): Schema\StatusWorkflowUsageDTO {
226
        return $this->call(
×
227
            uri: '/rest/api/3/statuses/{statusId}/workflowUsages',
×
228
            method: 'get',
×
229
            query: compact('nextPageToken', 'maxResults'),
×
230
            path: compact('statusId'),
×
231
            success: 200,
×
232
            schema: Schema\StatusWorkflowUsageDTO::class,
×
233
        );
×
234
    }
235
}
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